WDef
Group: Members
Posts: 798
Joined: Sep. 2005 |
|
Posted: July 08 2006,09:44 |
|
Checking that sufficient space is available before writing the backup file in theory is a good idea. The same thing has happened to me before - you lose both your current and former backups
There would be the question, though, of what would be "sufficient" space. AFAIK tar can't estimate the size of an archive before creating it, though it can count total bytes written using --totals
Perhaps a "backup" could be made first to /dev/null, bytes written counted with --totals - this would give the size of the potential backup -pre-compression.
gzip compression ratios spread between about 0.1 and 0.75 so a worst-case multiplier could be used to estimate the max possible size of the backup tarball. If this was greater than df -h showed free on the backup partition, the backup could be aborted.
Haven't tried this, might not work (--totals might not work when writing to /dev/null ?)
|