Bug #4646

Backups can fill the hard disk without warning

Added by Paul Rose over 5 years ago. Updated over 3 years ago.

Status:ResolvedStart date:2013-07-12
Priority:NormalDue date:
Assignee:Patrick Cherry% Done:

0%

Category:-
Target version:jessie

Description

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:

-s produces:

Filesystem Size Used Avail Use% Mounted on
/dev/vda2 24G 2.2G 21G 10% /

-e produces:

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.

History

#1 Updated by Patrick Cherry over 4 years ago

  • Target version set to jessie

#2 Updated by Patrick Cherry over 3 years ago

  • Status changed from New to Resolved

There's now a MOTD giving disc usage on login.

Also there is a disc output at the end of the email that lists how much space is left.

#3 Updated by Patrick Cherry over 3 years ago

  • Status changed from Resolved to New

actually maybe something better can 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.

#5 Updated by Patrick Cherry over 3 years ago

  • Assignee set to dedwards dedwards

#6 Updated by Patrick Cherry over 3 years ago

  • Assignee changed from dedwards dedwards to Patrick Cherry

#7 Updated by Patrick Cherry over 3 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF