Discussion:
[rsnapshot-discuss] rsnapshot without argument alpha, beta,...
steven meiers
2017-02-26 11:09:06 UTC
Permalink
hi,


did somebody write a bash/python script that keeps track of how many
alpha, beta, gamme, detal, ... backups have been made and which one
should be made next?

as far as i understand rsnapshot you just run alpha every x hours, beta
every day and so on with increasin intervals.
this makes sense on a host that is always on but would also shuffle the
directories around when no change was made...right?



ive got a scenario where the backup server is not always on but gets
turned on via wol when my local host detects that "enough" files have
changed so a backup is in order.
for that i rsync my local data to another directory on the same machine
and check rsyncs output, when there is enough change rsync transfers
the directory to the backup host, where rsnapshot should do its thing.


so should i write some code to log how often rsnapshot has ran and
incldue that in my backup procedure or is there a better way?
Peter Klausner
2017-03-02 17:49:15 UTC
Permalink
Hi Steven

Rolf Muth's do-rsnapshot wrapper should address your problem:
https://sourceforge.net/p/rsnapshot/mailman/message/28645455/

Alternatively, you may use my minimally patched up rsnapshot:
As you described, it checks the timestamps of all existing
backups and then decides which rotations and backup to run.
https://github.com/rsnapshot/rsnapshot/compare/master...pklausner:master

The easiest scenario would be one /etc/cron.hourly/rsnapshot
script to run everyting you need, eg:

#!/bin/sh

exec >> /var/log/rsnapshot 2>&1

if on_ac_power
then : we can proceed
else date "+[%Y-%m-%dT%T] skip because of no AC power"
exit 0
fi

for d in /var/backup /media/peter/usbdisk
do
test -r $d/rsnapshot.conf &&
df -m $d/rsnapshot.conf |
awk '/^.dev.sd/ { if ($4 < 10000) exit 1 }' &&
ionice -c 3 nice \
/usr/local/bin/rsnapshot -c $d/rsnapshot.conf all
done



HTH,
Peter
Post by steven meiers
hi,
did somebody write a bash/python script that keeps track of how many
alpha, beta, gamme, detal, ... backups have been made and which one
should be made next?
as far as i understand rsnapshot you just run alpha every x hours, beta
every day and so on with increasin intervals.
this makes sense on a host that is always on but would also shuffle the
directories around when no change was made...right?
ive got a scenario where the backup server is not always on but gets
turned on via wol when my local host detects that "enough" files have
changed so a backup is in order.
for that i rsync my local data to another directory on the same machine
and check rsyncs output, when there is enough change rsync transfers
the directory to the backup host, where rsnapshot should do its thing.
so should i write some code to log how often rsnapshot has ran and
incldue that in my backup procedure or is there a better way?
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
steven meiers
2017-03-11 10:12:00 UTC
Permalink
Post by Peter Klausner
Hi Steven
https://sourceforge.net/p/rsnapshot/mailman/message/28645455/
As you described, it checks the timestamps of all existing
backups and then decides which rotations and backup to run.
https://github.com/rsnapshot/rsnapshot/compare/master...pklausner:mas
ter
The easiest scenario would be one /etc/cron.hourly/rsnapshot
#!/bin/sh
exec >> /var/log/rsnapshot 2>&1
if on_ac_power
then : we can proceed
else date "+[%Y-%m-%dT%T] skip because of no AC power"
exit 0
fi
for d in /var/backup /media/peter/usbdisk
do
    test -r $d/rsnapshot.conf &&
        df -m $d/rsnapshot.conf |
            awk '/^.dev.sd/ { if ($4  < 10000) exit 1 }' &&
                ionice -c 3 nice \
                    /usr/local/bin/rsnapshot -c $d/rsnapshot.conf all
done
Hey, thanks for the very quick reply.
Will try that.

Loading...