rsync

kitepilot at kitepilot.com kitepilot at kitepilot.com
Tue Apr 30 13:09:05 MST 2013


> but doesn't '~' merely extrapolate to '/home'?
Yes, it does, but it happens *IN* the shell *BEFORE* it gets to 'rsync'.
Read 'bash globbing' for more information, that's something that you *WANT* 
to know. 

The '/' at the of the source reads as 'the contents of this directory'.
Without it, it reads as 'this directory'. 

The consecuence is that if:
Run a few tests to understand how it works.
ET 

 

Michael Havens writes: 

> but doesn't '~' merely extrapolate to '/home'?
> further, what does putting the slash '/' at the end of the destination
> directory do (rather than just saying '/dest/i/nation' <w/o the trailing
> slash>)?
> :-)~MIKE~(-: 
> 
> 
> On Tue, Apr 30, 2013 at 11:43 AM, Michael Havens <bmike1 at gmail.com> wrote: 
> 
>> thanks, buddy!
>> :-)~MIKE~(-: 
>>
>>
>> On Tue, Apr 30, 2013 at 8:14 AM, kitepilot at kitepilot.com <
>> kitepilot at kitepilot.com> wrote: 
>>
>>> Mike, read the man pages, your syntax is wrong and it is clearly stated
>>> when you:
>>> $ man rsync
>>> With that said, the syntax that you are concerned with in this instance
>>> is:
>>> rsync [OPTION...] SRC... [USER@]HOST:DEST
>>> A couple of details that may bite you:
>>> Don't rely on '~' to address a directory on the destination box.
>>> The '~' will be interpreted by the shell before the command is handed to
>>> 'rsync' and, if the tree in both boxes don't match, you'll get a mysterious
>>> error that won't make sense until you realize that 'bash globbing' is
>>> handing your 'rsync' the wrong path'
>>> That is also valid for:
>>> --exclude=.*mozilla*
>>> if '.*mozilla*' resolves to more than one path you will get interesting
>>> (and undecipherable) error messages.
>>> I would do it as:
>>> --exclude='.*mozilla*'
>>> So, the 'proper' construction would something like:
>>> $ rsync -vva \
>>>    --exclude='/home/bmike1/**Pictures/*' \
>>>    --exclude='.*mozilla*' \
>>>    --exclude='.*chromium*' \
>>>        xbmc at 192.168.0.3:/home/xbmc/**backupdirectoryname
>>> And remember:
>>> if you have any question,
>>> you will get any answer...    :)
>>> ET 
>>>
>>> 
>>>
>>> Michael Havens writes: 
>>>
>>>> I want to have a backup of the hard drives of the computers in my house
>>>> on
>>>> the other computer. What I was doing before is making each ~ identical.
>>>> Would the following command give me the desired effect?
>>>> rsync -vva --exclude=/home/bmike1/**Pictures/* --exclude=.*mozilla*
>>>> --exclude=.*chromium* ~/* *xbmc at 192.168.0.3:/home/xbmc/***
>>>> backupdirectoryname*;
>>>> rsync -vva --exclude=/home/bmike1/**Pictures/* --exclude=.*mozilla*
>>>> --exclude=.*chromium* xbmc at 192.168.0.3:/home/xbmc/
>>>> *~/backupdirectoryname*
>>>> *
>>>> *
>>>> is this correct?
>>>> :-)~MIKE~(-: 
>>>>
>>> ------------------------------**---------------------
>>> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.**org<PLUG-discuss at lists.phxlinux.org>
>>> To subscribe, unsubscribe, or to change your mail settings:
>>> http://lists.phxlinux.org/**mailman/listinfo/plug-discuss<http://lists.phxlinux.org/mailman/listinfo/plug-discuss> 
>>>
>> 
>>


More information about the PLUG-discuss mailing list