[Wiltshire] rsync very selectively

Ralph Corderoy ralph at inputplus.co.uk
Mon Jun 11 20:31:14 UTC 2012


Hi Dave,

> I can get the include file to copy .bash* but no matter what I try I
> can't persuade it to recursively do directories, in this case the
> scripts directory for starters. I've tried it with -r, --recursive,
> --dirs, with a training /, without a trailing /, trailing /* ......
> nothing works for me and I can't find a how-to.

Can we clarify what you're trying to do.

> rsync -av --recursive --include-from=/home/jf/scripts/BackupIncludes
>     --delete-excluded --exclude='*' --bwlimit=3000 /home/jf/
>     jf at server:/home/jf/DesktopHomeBackup
> 
> and the BackupIncludes file contains
> scripts/
> .bash*

    shopt -s nullglob &&
    cd /home/jf &&
    rsync -av scripts .bash* jf at server:/home/jf/DesktopHomeBackup

The scripts you mean is /home/jf/scripts and no other, and the .bash*
files are also in that directory if they exist?  That should mirror then
to DesktopHomeBackup/{scripts,.bash*} on the remote machine.

Cheers, Ralph.



More information about the Wiltshire mailing list