Using One Script to Back Up Linux and Solaris
Clark Cooper
Backups are one of many critical tasks systems administrators
must perform. Unfortunately, we too often hear horror stories of
those who have not done them. This article introduces two shell
scripts, Backup.sh and Restore.sh, which can be used
to handle cpio backups and restores for an administrator
needing a simple solution.
With a desire to have backup and restore scripts that can function
across both Linux and Solaris using a native command, cpio
was chosen as the archive method. Attempts with tar on Solaris
showed that the shipping version would not back up the root file
system as a relative path. Alternatively, the recommended Solaris
method of ufsdump was not included with Linux. Using cpio
itself did not come without problems. The GNU version typically
used on Linux appeared to output everything to standard error. For
instance, the following should have created two files, one for stdout
and the other for stderr:
find . -print | cpio -oacBv -O /dev/st0 1>/tmp/files 2>/tmp/files.err
Instead, output for both stdout and stderr were directed to /tmp/file.err.
Because there was a need to have these in their respective files,
a workaround had to be implemented.
|