Usage of the --exclude command?

Been beating my head against the wall for awhile on a config issue. I’ve been using rclone for months now with great success, first on ACD and now on GSuite. My commandline/script is as follows (this is Linux, an unRAID install):

rm /mnt/rclone-bak.log # remove the old backup
mv /mnt/rclone.log /mnt/rclone-bak.log # create the new backup
rclone sync --log-file /mnt/rclone.log --max-size=40G --copy-links --transfers=4 –exclude '/FOO/.’ --bwlimit=10M --verbose /mnt/user/ google_crypt:/ --checkers=10 -v

This removes a logfile from the previous run 2 prior, copies over the existing current logfile, then kicks off rclone in verbose mode with output piped to a file. I can tail these files to monitor status or just open them (hint: do not place them in a directory being backed up). The bolded portion however is a real problem…

The directory structure has /mnt at root level, my data of interest is in /mnt/user/manydirectoriestobackup

I have recently moved data to a new shared directory we’ll call FOO under user. Foo is about 60gig of 50Kb files, it’s not something I require to be backed up and the tiny file sizes push rclone into spasms with the Google API so my backup never completes! I’m in a 403 tarpit… How the bloody hell do I skip the FOO directory? I have tried each of the following to no result:

–exclude ‘/FOO/.
–exclude “/FOO/.
–exclude=’/FOO/.
–exclude ‘FOO/.
–exclude="/FOO/."
–exclude “FOO/.
–exclude=“FOO/.
–exclude “/mnt/user/FOO/.

(my asterisks are getting eaten by formatting but they’re there)

I have probably tried a few other combinations too! I have been told that the path should be relative to the one given to rclone for backup so I think I’ve got this right not giving it the full path. I have tried with and without a leading slash, I have tried dual and single quotes - I’m pretty sure single is correct. For bonus points there’s another share I’d ALSO like to skip so chaining two would be great but it’s much less critical as it’s simply a working directory.

I find lots of examples to skip lists of files from a text file but nothing to skip just one using --exclude that works for me. Can I have a syntax example please? Surely one of the ones above is right but unless I’ve lost track none worked for me.

Is no one excluding files from backups? Must I use a file list to do it? Surely I can’t be the only one who needs to be selective about what gets backed up. I’m now on v1.37-093-gb510c70cβ with the same results although I’ve not tried all of the various iterations again.

Here is one of mine with an exclude in it.

/usr/local/bin/rclone move $FROM $TO -c --no-traverse --transfers=3 --checkers=3 --delete-after --min-age 1m --log-file=$LOGFILE --stats 1m -v --exclude *partial~ --exclude _UNPACK*

Ah, thank you! Are those directories or files you’re trying to skip? I’ve just tried the following with no success.

rclone sync --log-file /mnt/rclone.log --max-size=40G --copy-links --transfers=4 --exclude FOO/. --bwlimit=10M --verbose /mnt/user/ google_crypt:/ --checkers=10 -v

Path I’m trying to block is /mnt/FOO/. So FOO and all of it’s files. I’m now going to try FOO* and see if that works, fingers crossed!

Edit: Nope!

Here’s the command line from the log. This is being run by a script so I’m wondering if there’s something tripping it up. I see quotes in this for instance that aren’t in the command I built. Is that possible? I may try this with an = in it?

2017/08/22 22:16:55 DEBUG : rclone: Version “v1.37-093-gb510c70cβ” starting with parameters [“rcloneorig” “–config” “/boot/config/plugins/rclone-beta/.rclone.conf” “sync” “–log-file” “/mnt/rclone.log” “–max-size=40G” “–copy-links” “–transfers=4” “–exclude” “FOO*” “–bwlimit=10M” “–verbose” “/mnt/user/” “google_crypt:/” “–checkers=10” “-v”]

I am skippping files because radarr/sonarr marks files with ~partial while coping and sabnzbd markes files with UNPACK when unpacking so want to avoid moving any of those “files in progress”.

I know it isn’t exactly what you were looking for but wanted to share how I use exclude in case it helps.

1 Like

Yup, one of the directories I’d like to --exclude is much the same, a work directory. The one I’m trying hardest to avoid right now is a PLEX metadata directory. I’ve moved it out of the VM I’m using over to my NAS and want to skip it. So far no joy but I’m still trying things and your example is one of the only ones I’ve even seen with this command lol. Adding the = didn’t help :frowning: