[Wiltshire] rsync very selectively
Ben
BenAtNoFixedAbode at lineone.net
Mon Jun 11 16:09:10 UTC 2012
My experience of the file copy commands on all operating systems is that
if you ask it to do it recursively and use a wild-card match it uses the
wild-card match to determine which directories to recurse into. Not at
all useful in my experience.
What I have done on Linux (there is basically no solution on Windows but
then we don't really care about that here do we) is use the find command
to isolate the files I am interested in and then perform whatever
command I want on them. However if you wish to preserve directory
structure it may not be that straight forward.
Anyway those are my thoughts, try find.
Cheers
Ben
On 11/06/12 16:46, David Fletcher wrote:
> Tried asking this question on the Ubuntu list on Friday but so far no
> replies :-(
>
>
>
> I want to use rsync to copy a very small selection of files from a
> desktop to a server. rsync works OK for me except to do this. I want to
> firstly exclude everything, then use an include file for the bits I do
> want.
>
> I found out from the usual google search how to exclude everything.
>
> 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.
>
> So, in desperation I'm asking for help!
>
> The command I'm running from inside a script as user jf is
> 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*
>
>
> Can anybody help with this please?
>
> Dave
>
>
> _______________________________________________
> Wiltshire mailing list
> Wiltshire at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/wiltshire
>
More information about the Wiltshire
mailing list