I run the following command as sudo everything works fine:

rsync -aAXv --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found",”/home/*/.thumbnails/*”,”/home/*/.cache/google-chrome/*”,”/home/*/.local/share/Trash/*”,”/home/*/.gvfs”} /* /mnt/JUKEBOX/Backup/LANbox

If I try running it as root either from cron or from a script it wants to ignore everything I have excluded in the command and backup everything from /mnt creating an infinite loop until the disk runs out of space. All I want to know is WHY? I then created a script to be run as root that excludes each directory manually which works but its so long I can't copy and paste it hence the script:

rsync -aAXv --delete --exclude '/dev/*' --exclude '/proc/*' --exclude '/sys/*' --exclude '/tmp/*' --exclude '/run/*' --exclude '/mnt/*' --exclude '/media/*' --exclude '/lost+found' --exclude '/home/*/.thumbnails/*' --exclude '/home/*/.cache/google-chrome/*' --exclude '/home/*/.local/share/Trash/*' --exclude '/home/*/.gvfs' /* /mnt/JUKEBOX/Backup/LANbox >> /var/log/backup.log

Just would like to know why I have to manually exclude things?

  • Just a tip, you can use --exclude-from=filename where filename contains the directories in separate lines. This will make it much easier if you ever wanted to add/remove from the exclude list.
    – Alaa Ali
    Sep 7, 2015 at 16:15
  • Yes that would work as well I would just worry about it ignoring that too and once again filling up my drive.
    – jaskerx
    Sep 7, 2015 at 17:34

1 Answer 1


You've got some very funky quotes in your exclude line. Some are normal " quotes, and others are quotes. I'd try to make everything one type of quote (preferably the former) and let us know if that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.