Features to Check For

The script described earlier, hostdump.sh, is the result of many years of tuning and enhancing and incorporates the efforts and ideas of many people. While it may not be the best backup script available, it does do several things that many shell scripts do not. Make sure that whatever backup script you use does the following:

Lots of error checking

I have seen too many shell scripts over the years that assume things. Do not assume that a simple command worked just because it always does. When you are automating things, check the return code of everything. If you can anticipate what will cause a given error, try writing the script so that it will fix it first before completely giving up.

Notification, notification, notification

I cannot emphasize this enough. If your script sees something that it isn’t used to seeing, then you should be notified. All good activities also should be logged, so that you may go check those logs to make sure everything worked. Too many restores have failed because someone didn’t read their backup logs. If you do have a script that notifies you when things go wrong, don’t assume that nothing is wrong if you don’t get mail. What if cron is down? What if some minor change that you made to the script causes it to abort without a notification? What if sendmail was or is down? Never assume anything.

Proper checking of an rsh command

Too many scripts check the return code of the rsh command and not the return code of the command that was ...

Get Unix Backup and Recovery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.