[rsync] include-from with different source points

Paul Slootman paul+rsync at wurtel.net
Mon Jun 29 13:56:59 GMT 2009

On Mon 29 Jun 2009, GravyFace wrote:
> I then tried the following, thinking "/" would be a common denominator
> in the paths in my include list:
> sudo rsync --progress -avz --include-from=/home/gravyface/backup.list
> / /mnt/usbbackup/localbackup/
> ...which then starts backing up the root partition, which is not what
> I want (but what I asked for, presumably).

As the manpage says:

           This  option is related to the --include option, ...

       This option is a simplified form of the --filter option that
       defaults to an include rule and does not allow the full
       rule-parsing syntax of normal filter rules.

       See the FILTER RULES section for detailed information on this

The point you need to see is that everything is included by default, so
specifying only include rules won't change anything. You also need to
exclude the rest. The FILTER RULES section explains it pretty well,
although you may need to get your head around how it works by
experimenting (use -n not to actually transfer anything then).

What you want to do might be easier to do as follows (not tested, I've
never tried it myself :-):

rsync --progress -avz --relative /home/gravyface/www/ /mnt/datadisk1/music/ /mnt/datadisk2/projects/ /mnt/usbbackup/localbackup/


More information about the rsync mailing list