Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 2001 > April 2001

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.



MarketPlace

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.

Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.

Learn Embedded Linux, $349
Hands-on kit teaches fundamentals of embedded Linux development on real target hardware. ARM9 SBC.

Workflow Enabled Help Desk & IT Service Management
Automate service desk activities and integrate processes across IT. Learn more here.

Wanna see your ad here?