Backups can fill the hard disk without warning
|Assignee:||Patrick Cherry||% Done:|
Currently the backup system will keep doing it's job until the hard disk is full, breaking other services and leaving some users confused until they think of disk space
There is no warning for the users either, regardless of whether they forward root@localhost mail (which they probably should be but that is for another issue).
It might be possible to check first to see if a backup can / should be done using backup2l's commands:
Filesystem Size Used Avail Use% Mounted on
/dev/vda2 24G 2.2G 21G 10% /
Estimating differential level-3 backup <all.1081> based on <all.108>...
20 / 4154 file(s), 9 / 344 dir(s), 175KB / 106.7MB (uncompressed)
skipping: 0 file(s), 2 dir(s), 0 B (uncompressed)
So the backup script could do something like:
Backup threshold = 10% # A user defined setting with a sane default somewhere.
Percentage of disk that will be used by the next backup:
106.7 / 24576 * 100 = 0.43%
Total percentage of disk used by backups:
10 + 0.43 = 10.43
Is this over 10? Yes. Abort backup, send email to root alerting that backups cannot be done.
#4 Updated by dedwards dedwards over 3 years ago
Patrick Cherry wrote:
actually maybe something better can be done.
Hopefully better, /etc/symbiosis/backup.d/pre-backup.d/05-check-availspace now checks for sufficient free space using the backup2l estimate option. Uses libfilesys-df-perl, which I've added a hard dependency for.