Discussion:
[rsnapshot-discuss] Can one run do the whole rotation?
Thierry Lavallee
2015-07-09 12:10:55 UTC
Permalink
Hi
Do we need to have a cron running for each level (daily, weekly, monthly)?
Or could the daily do the weekly and monthly rotation itself?

I ask because now we have 3 crons (daily, weekly, monthly) each calling
the same script. Which means that on the weekly run, the data is
transferred again from the source. But the data could just be taken off
the daily.0 at this point... it's the same thing.

Thanks
Thierry
Helmut Hullen
2015-07-09 13:05:00 UTC
Permalink
Hallo, Thierry,
Post by Thierry Lavallee
Do we need to have a cron running for each level (daily, weekly,
monthly)? Or could the daily do the weekly and monthly rotation
itself?
I ask because now we have 3 crons (daily, weekly, monthly) each
calling the same script. Which means that on the weekly run, the data
is transferred again from the source. But the data could just be
taken off the daily.0 at this point... it's the same thing.
???
The "weekly" and the "monthly" jobs only rename the existent backups and
then delete the oldest (and not more needed) backup of this level.

Renaming goes very quick. Deleting may need more time, but it transfers
nearly nothing.

Just take a look into the log file - it explains what the job does.

Please excuse my gerlish!

Viele Gruesse!
Helmut
Thierry Lavallee
2015-07-09 16:41:44 UTC
Permalink
Hey Helmut,

Oh! So you mean that when we run #1 (daily) the content is transferred
from source, but when #2 (weekly) is ran, the script gets the weekly
content from daily.0?

#1 = /usr/bin/rsnapshot -c
/root/scripts/backup/rsnapshot.server_cpbackup.conf daily
#2 = /usr/bin/rsnapshot -c
/root/scripts/backup/rsnapshot.server_cpbackup.conf weekly

This would mean that you necessarily need to have a daily for the rest
of the iteration to work?
Thanks!
--
Thierry
Scott Hess
2015-07-09 17:00:02 UTC
Permalink
Post by Thierry Lavallee
Oh! So you mean that when we run #1 (daily) the content is transferred
from source, but when #2 (weekly) is ran, the script gets the weekly
content from daily.0?
#1 = /usr/bin/rsnapshot -c
/root/scripts/backup/rsnapshot.server_cpbackup.conf daily
#2 = /usr/bin/rsnapshot -c
/root/scripts/backup/rsnapshot.server_cpbackup.conf weekly
This would mean that you necessarily need to have a daily for the rest of
the iteration to work?
Yes. rsnapshot has no idea at all what daily, weekly, or the other terms
mean, they're just strings. You can call them alpha, beta, gamma, doesn't
matter, it's the timing of the cron job which controls the interval
stride. When the cron job run, rsnapshot rotates the interval called up by
one, then steals the oldest of the previous interval. You can setup a
trivial rsnapshot.conf and run things manually a few times to experiment.

Here's a snippet of my fully-primed snapshot root to see what I mean:

***@nbackup:~$ ls -lt /.snapshots
total 292
drwxr-xr-x 8 root root 4096 Jul 7 06:00 hourly.0
drwxr-xr-x 8 root root 4096 Jul 7 00:00 hourly.1
drwxr-xr-x 8 root root 4096 Jul 6 18:00 hourly.2
drwxr-xr-x 8 root root 4096 Jul 6 12:00 hourly.3
drwxr-xr-x 8 root root 4096 Jul 6 06:00 daily.0
drwxr-xr-x 8 root root 4096 Jul 5 06:00 daily.1
drwxr-xr-x 8 root root 4096 Jul 4 06:00 daily.2
drwxr-xr-x 8 root root 4096 Jul 3 06:00 daily.3
drwxr-xr-x 8 root root 4096 Jul 2 06:00 daily.4
drwxr-xr-x 8 root root 4096 Jul 1 06:01 daily.5
drwxr-xr-x 8 root root 4096 Jun 30 06:01 daily.6
drwxr-xr-x 8 root root 4096 Jun 27 00:01 weekly.0
drwxr-xr-x 8 root root 4096 Jun 20 06:01 weekly.1
drwxr-xr-x 8 root root 4096 Jun 13 06:01 weekly.2
drwxr-xr-x 8 root root 4096 Jun 6 06:00 weekly.3
drwxr-xr-x 8 root root 4096 May 30 06:01 weekly.4
drwxr-xr-x 8 root root 4096 May 23 06:01 monthly.0
drwxr-xr-x 8 root root 4096 Apr 25 06:08 monthly.1
drwxr-xr-x 7 root root 4096 Mar 21 06:21 monthly.2
drwxr-xr-x 7 root root 4096 Feb 14 06:20 quarterly.0
drwxr-xr-x 7 root root 4096 Nov 22 2014 quarterly.1
drwxr-xr-x 7 root root 4096 Aug 22 2014 quarterly.2
drwxr-xr-x 7 root root 4096 May 23 2014 quarterly.3
...

Sometime tonight hourly.0 will be hourly.3 and will get renamed to
daily.0. Sometime Saturday night what is currently daily.2 will be
daily.6, and will be shifted to weekly.0. And so on.

-scott

Helmut Hullen
2015-07-09 16:56:00 UTC
Permalink
Hallo, Thierry,
Post by Thierry Lavallee
Oh! So you mean that when we run #1 (daily) the content is
transferred from source, but when #2 (weekly) is ran, the script gets
the weekly content from daily.0?
Perhaps.
If you have defined

interval daily 7

(what means the max. value for the daily backup), then the weekly job
first renumbers the existent weekly backups (1 number higher) and then
renames daily.6 to weekly.0

[...]
Post by Thierry Lavallee
This would mean that you necessarily need to have a daily for the
rest of the iteration to work?
Yes! Again: take a look into the log file.

Viele Gruesse!
Helmut
Loading...