I'm trying to combine multiple rsync commands into one command. Currently I use the following command:
/usr/bin/rsync --exclude-from=/directory/exclude.txt --delete --rsync-path "/usr/bin/sudo /usr/bin/rsync" -e 'ssh' -rtogpu /directory user@server:/directory
This command is executed 5 times with different directories. I've tried to combine these 5 commands into one command using
--files-from=include.txt like this:
/usr/bin/rsync --delete --rsync-path "/usr/bin/sudo /usr/bin/rsync" -e 'ssh' -rtogpu --files-from=/directory/include user@server:/directory
Unfortunately this didn't do the trick, is there a good way to do this with rsync? And if so how would I be able to do that?
Just to be clear, I need to synchronize the entire content of the directories, not just single files.
Thanks in advance!
My include file is like this:
/directory/lower-dir/even-lower-dir/ /directory/lower-dir/ /directory/lower-dir/even-lower-dir/lowest-dir/
I've tried it with and without trailing slashes at the end as Roomney suggested but it didn't matter.