Martin Schweizer wrote:
Hello Steve
I copied once a week my filesystems /, /usr and /var to a second hard drive
with the following cron batch (it also mailed my the important files, fstab,
dmesg.boot and disklabes):
# Löschen der bestehenden Dateien
/bin/rm /disk2/backup/*.dmp
# Dump wird erstellt. Wenn nicht erfolgreich (-> exit codes),
# wird ein Mail an [EMAIL PROTECTED] versendet
/sbin/dump -0au -f /disk2/backup/usr_$datum.dmp /usr || /usr/bin/mail -s Backup-Fehler [EMAIL PROTECTED]
I see a risk here, in case dump fails: you're left with nothing.
Wouldn't it be better to do it in this order:
/sbin/dump -0au -f /disk2/safe_backup/usr_$datum.dmp /usr
<etc. etc.>
if [ <successful> ]; then
rm -rf /disk2/backup
mv /disk2/safe_backup /disk2/backup
else
<send error message>
fi
If the dump fails, you also get the error message, but now
the previous dump backup is still there!
Rob.
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"