Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running the following rsync command nightly:

rsync -varhR --delete --stats --files-from=files_to_include / /media/drive/snapshots/nightly.0

Here is the files_to_include file


If I take a look in /var/www/html/ I have several folders and files

If I take a look in /media/drive/snapshopshots/nightly.0/var/www/html/, its completely empty. No files or directories here.

So for some reason, that html folder is not getting sync'ed.

I manually tried running this command:

rsync -varhR --delete --stats /var/www/ /media/drive/snapshots/nightly.0

And then it sync'ed correctly. So something is going on with the --files-from flag I guess. Are there some sort of limitations to that option?

share|improve this question
how are you running this command? is it a cronjob? – The Unix Janitor Nov 22 '10 at 20:43
yes, cronjob as root – Jake Wilson Nov 22 '10 at 20:51
Did you try with --files-from=files_to_include on the command line? Did you try with a different --files-from file? If you created files_to_include on a Windows machine, did you check for spurious CRs? – Gilles Nov 22 '10 at 21:02
Also run it with -v to get verbose output. This will tell you WHAT its trying to sync. I was able to run that exact command (with a different destination) with no issues. – Andrew M. Nov 22 '10 at 21:25

If running it from cron, it is best to fully specify the path to files_to_include

I usually redirect output to a file so I can later check for error messages

0 23 * * * /a/b/rsync ... --files-from=/c/d/f2inc ... > /tmp/rsync.log 2>&1
share|improve this answer

Make those paths in the include file absolute. i.e. /var/www/ instead of var/www/

share|improve this answer
The paths in the include file are relative to whatever you specify in as the source directory in the command, which in my case is "/". If I added a / to the front of them, the paths would end up "//var/www" – Jake Wilson Nov 23 '10 at 18:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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