Copy just some files/folders from local storage to gdrive?

If i have a local folder, eg C:\MyFolder, and this contains a lot of subfolders,
Subfolder1
Subfolder2
Subfolder3
Subfolder4 etc..
How can i make rclone skip certain files and/or folders when performing a copy? Lets say i wanna copy just Subfolder 1, 2 and 3, in normal cases i would just do "rclone copy MyFolder gdrive:/MyFolder, but since i dont wanna copy everything inside over, is it a way to sort of "mark" everything you want to be copied with a single command, or a way to skip certain files?

Ofc i can do "rclone copy MyFolder\Subfolder1 gdrive:/MyFolder/Subfolder1" and repeat for each folder but this process might take forever for dealing with a large folder-structure. Thanks!

each time you run rclone copy, it will only copy changed files.
if no files have changed, no files will be copied.

if you want to skip certain folders or files, you can use filtering
https://rclone.org/filtering/
take a read and then if you have any questions ask

for example,

rclone.exe copy C:\MyFolder remote:/MyFolder -vv --filter-from=filters.txt

and this is the filters.txt

+ /Subfolder1/**
- /Subfolder2/**
- /Subfolder3/**
+ /Subfolder4/**

output:

2020/04/05 14:38:06 DEBUG : Subfolder2: Excluded
2020/04/05 14:38:06 DEBUG : Subfolder3: Excluded
2020/04/05 14:38:06 DEBUG : Subfolder3: Excluded
2020/04/05 14:38:06 DEBUG : S3 bucket aliasremote path MyFolder: Waiting for checks to finish
2020/04/05 14:38:06 DEBUG : Subfolder4/4.txt: Size and modification time the same (differ by 0s, within tolerance 100ns)
2020/04/05 14:38:06 DEBUG : Subfolder4/4.txt: Unchanged skipping
2020/04/05 14:38:06 DEBUG : Subfolder1/1.txt: Size and modification time the same (differ by 0s, within tolerance 100ns)
2020/04/05 14:38:06 DEBUG : Subfolder1/1.txt: Unchanged skipping
2020/04/05 14:38:06 DEBUG : S3 bucket aliasremote path MyFolder: Waiting for transfers to finish
2020/04/05 14:38:06 INFO  : There was nothing to transfer
2020/04/05 14:38:06 INFO  : 
Transferred:   	         0 / 0 Bytes, -, 0 Bytes/s, ETA -
Checks:                 2 / 2, 100%
Elapsed time:         0.0s
1 Like

@ncw, hi,

do you know why i am getting this twice in the debug output?

2020/04/05 14:38:06 DEBUG : Subfolder3: Excluded
2020/04/05 14:38:06 DEBUG : Subfolder3: Excluded

rclone: Version "v1.51.0-151-gfc663d98-beta" starting with parameters ["C:\data\rclone\scripts\rclone-v1.51.0-151-gfc663d98.exe" "copy" "C:\MyFolder" "remote:/MyFolder" "-vv" "--filter-from=filters.txt"]

here are the contents of C:\MyFolder

C:\data\rclone\scripts\rr\other\test>C:\data\rclone\scripts\rclone-v1.51.0-151-gfc663d98.exe lsf -R C:\MyFolder\
Subfolder1/
Subfolder2/
Subfolder3/
Subfolder4/
Subfolder2/2.txt
Subfolder3/3.txt
Subfolder1/1.txt
Subfolder4/4.txt

Thanks, i read a little more about this and will try it out soon. Looks promising.

Forgot to thank you, this worked very well. Perfect! :slightly_smiling_face:

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