[TriLUG] setting up rsync

Aaron S. Joyner aaron at joyner.ws
Mon Feb 9 17:06:10 EST 2004


It means every two _minutes_.  :)  Yes, you can use the --exclude option 
with any style of rsync, as far as I'm aware.

The first column in the crontab listing is for minutes, they are in 
order as follows:
minute
hour
day of month
month
day of week

You can use the divide-by operator like */2 to indicate every minute (*) 
divided by 2, thus... every other minute.
* */2 * * * /foo/bar # would indicate every other hour.
* * */2 * * /foo/bar # would indicate every other day
etc

I'm not entirely sure what happens in roll-over conditions where the 
thing you're dividing (mins, hours, etc) results with a remainder.  I'd 
suspect that since it's referred to as "steps" in the man page, that it 
would simply result in it always beginning on the first step - i.e. 
every top of the hour (or day, or whatever) the cycle would begin again, 
instead of continuing on with the remainder.  But if anyone has tested 
that obscure facet, I'd love to know.  :)

Aaron J.


Turnpike Man wrote:

>Can the --exclude /path/to/exclude/ also be used in the rsync server/client as
>I have decided to use?
>
>I went server/client b/c I didn't want to muck with setting up the RSA stuff
>required to do rsync via ssh without a password requirement.
>
>thanks!
>David M.
>
>PS, and in learning more about crontab, does that mean every 2 hours the way
>you wrote it?  thanks!
>
>
>--- "Aaron S. Joyner" <aaron at joyner.ws> wrote:
>  
>
>>A crontab entry something like this should do the trick:
>>*/2 * * * * /usr/local/bin/rsync -a --delete -e ssh --exclude 
>>'files/*/to/exclude' /path/to/local/files/ 
>><remotemachine>:/remote/path/to/store/
>>
>>This will sync the directory on the local host with the remote host 
>>every 2 minutes.  It will always consider the local host to be 
>>authoritative, and if something is deleted locally, it will delete it 
>>remotely on the next sync.  If something is changed on the remote side, 
>>it will get blown away on the next sync.
>>
>>
>>Aaron J.
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Finance: Get your refund fast by filing online.
>http://taxes.yahoo.com/filing.html
>  
>





More information about the TriLUG mailing list