PIKT

Samples: Nightly Backups

PIKT Logo
Home FAQ News Intro Samples Tutorial Reference Software Authors Licensing SiteSearch


backup_nightly.sh.html is a shell script to perform nightly backups of important data directories.  This is the script version customized for the system ottawa as sourced from the backup_nightly_programs.cfg file.

#!/bin/bash

RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh

# backup ottawa's /home/brahms

#$RSYNC -vap --delete --rsh=$SSH /home/brahms calgary-bak:/home

# backup /home/pikt

$RSYNC -vap --delete --rsh=$SSH /home/pikt /arc/ottawa/home
$RSYNC -vap --delete --rsh=$SSH /home/pikt calgary-bak:/arc/ottawa/home

# backup /etc

$RSYNC -vap --delete --rsh=$SSH ottawa-bak:/etc /arc/ottawa
$RSYNC -vap --delete --rsh=$SSH toronto-bak:/etc /arc/toronto
$RSYNC -vap --delete --rsh=$SSH calgary-bak:/etc /arc/calgary
$RSYNC -vap --delete --rsh=$SSH vancouver-bak:/etc /arc/vancouver
$RSYNC -vap --delete --rsh=$SSH montreal-bak:/etc /arc/montreal
$RSYNC -vap --delete --rsh=$SSH winnipeg-bak:/etc /arc/winnipeg

# backup /usr/local

$RSYNC -vap --delete --rsh=$SSH ottawa-bak:/usr/local /arc/ottawa/usr
$RSYNC -vap --delete --rsh=$SSH toronto-bak:/usr/local /arc/toronto/usr
$RSYNC -vap --delete --rsh=$SSH calgary-bak:/usr/local /arc/calgary/usr
$RSYNC -vap --delete --rsh=$SSH vancouver-bak:/usr/local /arc/vancouver/usr
$RSYNC -vap --delete --rsh=$SSH montreal-bak:/usr/local /arc/montreal/usr
$RSYNC -vap --delete --rsh=$SSH winnipeg-bak:/usr/local /arc/winnipeg/usr

# backup /var/www

$RSYNC -vap --delete --rsh=$SSH ottawa-bak:/var/www /arc/ottawa/var
$RSYNC -vap --delete --rsh=$SSH toronto-bak:/var/www /arc/toronto/var
$RSYNC -vap --delete --rsh=$SSH vancouver-bak:/var/www /arc/vancouver/var

# backup /var/log/httpd

$RSYNC -vap --delete --rsh=$SSH
       toronto-bak:/var/log/httpd /arc/toronto/var/log
$RSYNC -vap --delete --rsh=$SSH
       vancouver-bak:/var/log/httpd /arc/vancouver/var/log

# backup /usr/lib/mailman

$RSYNC -vap --delete --rsh=$SSH
       toronto-bak:/usr/lib/mailman /arc/toronto/usr/lib

# backup /var/lib/mailman

$RSYNC -vap --delete --rsh=$SSH
       toronto-bak:/var/lib/mailman /arc/toronto/var/lib

[For more examples, see Samples.]


Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | Authors | Licensing | SiteSearch
Links | SiteIndex | Pikt-Users | Pikt-Workers | Contribute | ContactUs | Top of Page
Page best viewed at 1024x768.   Page last updated 2005-06-22.
This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund.  All rights reserved.

Computer Books at Amazon.com

UNIX System Administration Handbook
UNIX System Administration Handbook

From Bash to Z Shell: Conquering the Command Line
From Bash to Z Shell: Conquering the Command Line

Unix Power Tools
Unix Power Tools

Unix in a Nutshell: A Desktop Quick Reference
Unix in a Nutshell: A Desktop Quick Reference

Essential CVS
Essential CVS