lamp-backup icon indicating copy to clipboard operation
lamp-backup copied to clipboard

Handle `$KEEP_NUM_RECENT` being set to 0

Open star-szr opened this issue 10 years ago • 0 comments

First of all, thanks for open sourcing this! I looked around at a lot of options and this fit my needs best.

I was playing around with these config options:

KEEP_NUM_RECENT=0
KEEP_NUM_MONTHLIES=0

And noticed errors like:

du: cannot access `/var/backup/backup_2015-02-10-1423608909': No such file or directory

This change accounts for the possibility that the local backups may have been immediately rotated out. Another approach would be to check and store the disk space used before rotating. This is the quick and dirty "solution" to get the discussion started, I'd be happy to dig deeper to come up with a better PR :)

Edit: …although checking the disk space ahead of time it would still be displaying a non-existent directory so that probably wouldn't make sense. So this is maybe the simplest and least confusing solution for this without having to check S3 configuration and all that.

star-szr avatar Feb 10 '15 23:02 star-szr