logo       

Re: Need someone to look over my cron for rsnapshot: msg#00058

sysutils.backup.rsnapshot.general

Subject: Re: Need someone to look over my cron for rsnapshot

On Wed, Jul 19, 2006 at 09:06:55PM -0400, Pigeon wrote:
> Hello, and thanks David for the rsnapshot advice... I am trying to
> setup cron to mirror my rsnapshot.conf interval (which is:)
> interval hourly 6 'every 4 hours
> interval daily 7 'every day
> interval weekly 4 'every week
> interval monthly 12 'every month
>
>
> 0 */6 * * * /usr/local/bin/rsnapshot hourly 'will run every 4
> hours every day
> 15 0 * * * /usr/local/bin/rsnapshot daily 'will run every day
> at 12:15am
> 30 1 * * 0 /usr/local/bin/rsnapshot weekly 'run 1:30am every sunday
> 45 2 1 * * /usr/local/bin/rsnapshot monthly 'run 2:45 every 1st of
> the month
>
>
> Are my comments right? and does my cron match my rsnapshot interval?

Looks like your comments are right, except the */6 for hourly should be
*/4.

However, I recommend doing the intervals in the opposite order (highest
first rather than lowest first).

This is an extract from the rsnapshot man page in CVS :-
``
Here is an example crontab entry, assuming that intervals hourly,
daily, weekly and monthly have been defined in /etc/rsnapshot.conf

0 */4 * * * /usr/local/bin/rsnapshot hourly
50 23 * * * /usr/local/bin/rsnapshot daily
40 23 * * 6 /usr/local/bin/rsnapshot weekly
30 23 1 * * /usr/local/bin/rsnapshot monthly

This example will do the following:

6 hourly backups a day (once every 4 hours, at 0,4,8,12,16,20)
1 daily backup every day, at 11:50PM

1 weekly backup every week, at 11:40PM, on Saturdays (6th day of
week)

1 monthly backup every month, at 11:30PM on the 1st day of the
month

It is usually a good idea to schedule the larger intervals to run a bit
before the lower ones. For example, in the crontab above, notice that
"daily" runs 10 minutes before "hourly". The main reason for this is
that the daily rotate will pull out the oldest hourly and make that the
youngest daily (which means that the next hourly rotate will not need
to delete the oldest hourly), which is more efficient. A secondary
reason is that it is harder to predict how long the lowest interval
will take, since it needs to actually do an rsync of the source as well
as the rotate that all intervals do.

If rsnapshot takes longer than 10 minutes to do the "daily" rotate
(which usually includes deleting the oldest daily snapshot), then you
should increase the time between the intervals. Otherwise (assuming
you have set the lockfile parameter, as is recommended) your hourly
snapshot will fail sometimes because the daily still has the lock.
''

I guess I could add here that you could get around the locking problem
itself by enabling use_lazy_deletes (so the delete happens after rsnapshot
unlocks), but I still think its better to increase the separation time
between rsnapshots - even if you avoid locking problems you don't really
want to have deletes happening at the same time as other rsnapshots.

___________________________________________________________________________
David Keegel <djk@xxxxxxxxxxxxxxxxxx> http://www.cyber.com.au/users/djk/
Cybersource P/L: Linux/Unix Systems Administration Consulting/Contracting

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise