0

If you backup a linux server using the dump command is there a way to check if the dump was actually succesful apart from witnessing the files have been created and are an appropriate size?

2 Answers2

3

Some suggestions:

  1. Check the exit code from the dump program.
  2. Do a test restore of a single known file from the file system in question.
  3. As above but from a randomly chosen file.
  4. As above but a file known to have changed recently.
  5. If you are dumping to tape make sure that the tape contains the number of filesystem's you backed up (lots of people find out about the rewind device works here).
  6. restore the dump to /dev/null, check that worked ok.
  7. Look at some of the flags dump takes. -u to update /var/lib/dumpdates, -F to run a script at the end of the dump, -I to tune error tolerance might be helpful to you.

All the above are going to depend on how much time you have to do the dump, how big and how many the FS'es are etc.

Remember: It's not backed up until it's been restored and tested (in front of your manager!).

gm3dmo
  • 10,057
  • 1
  • 42
  • 36
  • To check the exit code in a script you can use the `$?` variable: /sbin/dump ... if ( $? != "0" ) then #backup failed – einstiien Jan 21 '10 at 15:03
  • An additional check is to mail the output of the dump(8) command, which should happen automatically if dump(8) is run from a crontab (and assuming the system is able to send emails). – Bram Schoenmakers Jul 07 '10 at 07:37
0

you could use checksums. but the safest way is to restore from your backup. you do not have to test every backup, but once in a wile you should restore a backup on a different machine. this way you will know for sure whether your backup works or not.

Christian
  • 4,703
  • 2
  • 24
  • 27