--ignore-existing dry run still copies although files already exist in destination

What is the problem you are having with rclone?

We're currently trying to run a report on how many files exist in the source remote, but not in the destination. We're currently running the command:

Rclone copy “source:C:\DATA\” destination: -P -v --ignore-existing

What is your rclone version (output from rclone version)

- os/version: Microsoft Windows Server 2012 R2 Standard (64 bit)
- os/kernel: 6.3.9600.20094 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.16.5
- go/linking: dynamic
- go/tags: cmount

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows Server

Which cloud storage system are you using? (eg Google Drive)

Google Shared Drives

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Rclone copy “source:C:\DATA\” destination: -P -v --ignore-existing

The rclone config contents with secrets removed.

[source]
type = local

[destination]
type = drive
client_id = redacted.apps.googleusercontent.com
client_secret = redacted
scope = drive
token = {"access_token":"redacted","token_type":"Bearer","refresh_token":"redacted","expiry":"2021-08-23T16:44:53.0167204+01:00"}
team_drive = redacted
root_folder_id = 

A log from the command with the -vv flag

Not going to include the log here. Main thing is that a file, "aluminium.pdf" exists both in the source, and the destination, yet the dry run log says

2021/08/24 15:33:36 NOTICE: aluminium.pdf: Skipped copy as --dry-run is set (size 1.653Mi)

Skipped copy; surely it should say

Duplicate object found in destination - ignoring

This is happening for many files that exist in both the source in the destination. This is a problem as we're using the comparison between the files moved and the files duplicated to run a report on the 'delta' between the source and destination.

Advice is much appreciated!

hi,

  • you have duplicates in gdrive, is that the problem?
  • can you post a debug log with the problem; perhaps change the source to point that file?
  • curious why use source:C:\DATA instead of C:\DATA?
  • just wanted to be sure you know about rclone check?
    " + path means path was missing on the destination, so only in the source"

i did a quick test, tho i do not have duplicates in my gdrive

rclone.exe copy test.txt gdrive-a1b2:testfolder01 -vv --ignore-existing --dry-run 
DEBUG : rclone: Version "v1.56.0" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "copy" "test.txt" "gdrive-a1b2:testfolder01" "-vv" "--ignore-existing" "--dry-run"]
DEBUG : Creating backend with remote "test.txt"
DEBUG : fs cache: adding new entry for parent of "test.txt", "//?/C:/data/rclone/scripts/rr/other/newtest"
DEBUG : Creating backend with remote "gdrive-a1b2:testfolder01"
DEBUG : test.txt: Destination exists, skipping
1 Like

If you use ignore existing, it doesn't care if there is a copy there as it'll copy it over it since you picked to ignore existing.

hi,
i thought it was the opposite behavior.
if the file exists in the dest, no matter the modtime and/or size of the source file, do not copy to dest?

in my testing, with or without --dry-run, rclone will not copy the file.

rclone lsf C:\data\rclone\scripts\rr\other\newtest\file.txt --format="pst" 
274;2021-08-24 13:45:22

rclone lsf  lsf gdrive-a1b2:testfolder01/file.txt --format="pst" 
273;2021-08-14 19:18:56

rclone copy C:\data\rclone\scripts\rr\other\newtest\file.txt gdrive-a1b2:testfolder01 --ignore-existing -vv 
rclone: Version "v1.56.0" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "copy" "file.txt" "gdrive-a1b2:testfolder01" "--ignore-existing" "-vv"]
Creating backend with remote "file.txt"
fs cache: adding new entry for parent of "file.txt", "//?/C:/data/rclone/scripts/rr/other/newtest"
Creating backend with remote "gdrive-a1b2:testfolder01"
file.txt: Destination exists, skipping

Hey,

  • you have duplicates in gdrive, is that the problem?

Negative, we don't have any duplicates in Google Drive. For instance, there is only one "aluminium.pdf" file.

  • can you post a debug log with the problem; perhaps change the source to point that file?

This is a 90GB+ Drive. Logs would just tell the same story as I did above. Some files are 'checked' and considered not for transfer, some files are 'transferred'. (Obviously this is a dry run so none of this is taking place)

  • curious why use source:C:\DATA instead of C:\DATA?

We established a local remote source:. It looks like that's not necessary, but it shouldn't change the outcome.

  • just wanted to be sure you know about rclone check?

Not heard of rclone check - will try to run this command and see if it's useful. There may be an issue that some files have been edited in the destination which it won't consider a 'match' that we need it to consider a match. If the filename is the same, the file is there.

" + path means path was missing on the destination, so only in the source"

If you use ignore existing, it doesn't care if there is a copy there as it'll copy it over it since you picked to ignore existing.

According to the documentation:

"Using this option will make rclone unconditionally skip all files that exist on the destination"

From the docs, it would seem like that would have the opposite behaviour.

Yeah, I had it flipped as mentioned above. I get things wrong here and there as well.

1 Like

i shared my time to post a simple set of commands, two rclone lsf and a rclone copy.
the logs show correct behavior.

to take it a step further, i deleted the dest file and re-ran the rclone copy --ignore-existing.
again, rclone performs the correct action

rclone delete gdrive-a1b2:testfolder01/file.txt -vv 
DEBUG : rclone: Version "v1.56.0" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "delete" "gdrive-a1b2:testfolder01/file.txt" "-vv"]
DEBUG : Creating backend with remote "gdrive-a1b2:testfolder01/file.txt"
DEBUG : Waiting for deletions to finish
INFO  : file.txt: Deleted
DEBUG : 4 go routines active

rclone copy C:\data\rclone\scripts\rr\other\newtest\file.txt gdrive-a1b2:testfolder01/file.txt --ignore-existing -vv --dry-run 
DEBUG : rclone: Version "v1.56.0" starting with parameters ["c:\\data\\rclone\\scripts\\rclone.exe" "copy" "C:\\data\\rclone\\scripts\\rr\\other\\newtest\\file.txt" "gdrive-a1b2:testfolder01/file.txt" "--ignore-existing" "-vv" "--dry-run"]
DEBUG : Creating backend with remote "C:\\data\\rclone\\scripts\\rr\\other\\newtest\\file.txt"
DEBUG : fs cache: adding new entry for parent of "C:\\data\\rclone\\scripts\\rr\\other\\newtest\\file.txt", "//?/C:/data/rclone/scripts/rr/other/newtest"
DEBUG : Creating backend with remote "gdrive-a1b2:testfolder01/file.txt"
DEBUG : file.txt: Need to transfer - File not found at Destination
NOTICE: file.txt: Skipped copy as --dry-run is set (size 275)

2021/08/24 15:33:36 NOTICE: aluminium.pdf: Skipped copy as --dry-run is set (size 1.653Mi)
imho, either this is human error or a bug with rclone.
without a good set of logs, no way to know....

Hi Wiktor,

I guess the examples posted by @asdffdsa are ment to inspire you to pick a single file where you see the issue (E.g. aluminium.pdf) and then check/post the output from these commands

rclone lsl "source:C:\DATA\" --include "yourFileNameHere"
rclone lsl destination: --include "yourFileNameHere"
rclone copy "source:C:\DATA\" destination: -v --ignore-existing --dry-run --include "yourFileNameHere"

The above commands may take some time if you have many files, rclone will need to traverse the entire folder structure to find yourfile.

You can speed up the search if you know the exact folders by doing like this:

rclone lsl "source:C:\DATA\yourIssueFolder\here" --include "yourFileNameHere"
rclone lsl destination:yourIssueFolder/here --include "yourFileNameHere"
rclone copy “source:C:\DATA\yourIssueFolder\here” destination:yourIssueFolder/here -v --ignore-existing --dry-run --include “yourFileNameHere”

If you do this, then @asdffdsa has much better possibilities to understand your situation and help you out.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.