Discussion:
[rsnapshot-discuss] Automatically deleting old backups when out of disk space?
Brian Kendall
2008-08-21 21:26:56 UTC
Permalink
I'd like to configure rsnapshot so that when my backup drive doesn't have
enough space to complete a backup, it'll delete the oldest monthly backups
until enough space is available. (This is very similar to the behavior of
Time Machine in Mac OS X.) It doesn't seem like there's an option to do
this built into rsnapshot, so does anyone have any ideas on how it could
be accomplished?

I was thinking I could create a pre-backup script that checked available
space and deleted the backups, but I'm not altogether sure of how to do
that in Linux. Does such a script for that already exist out there
somewhere for rsnapshot? If not, what's the easiest way to go about
accomplishing this?

thanks in advance,

- Brian
brian @at@ anzovin .dot. com
Anthony Ettinger
2008-08-21 21:30:54 UTC
Permalink
I suppose you could look at the size of the last completed backup to
get a general idea (or average of the last 3) and check diskspace
before the each backup is triggered, deleting enough space (starting
at the oldest backup, and moving forward) until you have 1.5 times the
diskspace.

As for implementation, I would look for a hook or trigger you can
attach the check to, something like a: "before_backup:
run_this_command.sh"...

I have no idea what's in place for that.
Post by Brian Kendall
I'd like to configure rsnapshot so that when my backup drive doesn't have
enough space to complete a backup, it'll delete the oldest monthly backups
until enough space is available. (This is very similar to the behavior of
Time Machine in Mac OS X.) It doesn't seem like there's an option to do
this built into rsnapshot, so does anyone have any ideas on how it could
be accomplished?
I was thinking I could create a pre-backup script that checked available
space and deleted the backups, but I'm not altogether sure of how to do
that in Linux. Does such a script for that already exist out there
somewhere for rsnapshot? If not, what's the easiest way to go about
accomplishing this?
thanks in advance,
- Brian
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
--
Anthony Ettinger
408-656-2473
http://anthony.ettinger.name
David Keegel
2008-08-21 22:23:10 UTC
Permalink
I think it would be simpler to make this a separate cron job that
is scheduled for say an hour before rsnapshot starts.
Post by Anthony Ettinger
I suppose you could look at the size of the last completed backup to
get a general idea (or average of the last 3) and check diskspace
before the each backup is triggered, deleting enough space (starting
at the oldest backup, and moving forward) until you have 1.5 times the
diskspace.
As for implementation, I would look for a hook or trigger you can
run_this_command.sh"...
I have no idea what's in place for that.
Post by Brian Kendall
I'd like to configure rsnapshot so that when my backup drive doesn't have
enough space to complete a backup, it'll delete the oldest monthly backups
until enough space is available. (This is very similar to the behavior of
Time Machine in Mac OS X.) It doesn't seem like there's an option to do
this built into rsnapshot, so does anyone have any ideas on how it could
be accomplished?
I was thinking I could create a pre-backup script that checked available
space and deleted the backups, but I'm not altogether sure of how to do
that in Linux. Does such a script for that already exist out there
somewhere for rsnapshot? If not, what's the easiest way to go about
accomplishing this?
thanks in advance,
- Brian
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
--
Anthony Ettinger
408-656-2473
http://anthony.ettinger.name
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
--
___________________________________________________________________________
David Keegel <***@cybersource.com.au> http://www.cyber.com.au/users/djk/
Cybersource P/L: Linux/Unix Systems Administration Consulting/Contracting
Helmut Hullen
2008-08-22 06:13:00 UTC
Permalink
Hallo, Brian,
Post by Brian Kendall
I'd like to configure rsnapshot so that when my backup drive doesn't
have enough space to complete a backup, it'll delete the oldest
monthly backups until enough space is available.
That's no good idea - sorry.
Normally rspnapshot adds about 60 MBytes (max. 1 GByte) with each backup
for my biggest machine (about 40 GByte to save).
It rotates to yearly backups too.

If some skript would delete the old backups I'd be very unhappy - I make
backups to save old data, not to delete them.

If there isn't enough place to store the new data I need a new disk. And
then I first copy all data with "rsnapshot-copy", and then I put the old
disk into my safe.

-------------------------

Maybe you should first look if there are any files which don't need to
be saved. Especially databases shouldn't be backupped with "rsnapshot"
or a similar tool.

rsnapshot du hourly

tells you how big the difference between 2 backups is.

Viele Gruesse!
Helmut

Loading...