#!/bin/bash # A simple shell script to backup dirs to tape drive. # ------------------------------------------------------------------------- # Copyright (c) 2005 nixCraft project <http://cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # ------------------------------------------------------------------------- MT=/bin/mt TAR=/bin/tar LOGGER=/usr/bin/logger # What to backup. SOURCE_DIRS="/data /home /etc /root /www" # Where to backup to. TAPE="/dev/st0" # log message $LOGGER "Backing $SOURCE_DIRS to $TAPE @ $(date)" # Rewind the tape $MT -f $TAPE rewind # Backup the files $TAR czf $TAPE $SOURCE_DIRS # Rewind and eject the tape $MT -f $TAPE rewoffl # log message $LOGGER "Backup finished @ $(date)"
4000+ howtos and counting! If you enjoyed this article, join 45000+ others and get free email updates!
Click here to subscribe via email.
Click here to subscribe via email.
- Download Script
- Email this to a friend
- Rss Feed
- Last Updated: 09/1/09





