This little article contains some useful tips and tricks about using tar.
When your starting point for the tar is situated at /, you may already have noticed the warning output from it:
In case of an automated backup, where the tar is executed using cron, this warning quickly becomes annoying: most systems mail the output of a cron job to a specified email address (and in any normal scenario, this is configured properly to know whether a backup succeeds or fails). If each time you get a mail with only this warning (the rest of the backup was succesfully completed), one might actually lean towards suffering from a nervous breakdown (if only for receiving the useless mail every once in a while).
A trick to circumvent it, and kick out the warning, is by constructing your tar command line like so:
tar -C / -cjf /srv/data/backup/etc.tar.bz2 etc/
This tells tar to cd to the / first, before starting the archive process. You could rewrite the command above like so:
cd / && tar -cjf /srv/data/backup/etc.tar.bz2 etc/
But then, if you need to return to the directory you were in, that would require some more programming.
« ‹ | November 2024 | › » | ||||
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |