#!/bin/bash ## bkall: backup script -- Eugene Reimer 2002-Dec ## commandline: ## bkall full ## bkall incr ## bkall export ## examples: ## bkall full --make tarfile backups, on disk ## bkall export --write todays tarfiles to a CD ## bkall export 20041228 --write the tarfiles from 2004Dec28 to a CD (added this on 2004dec29 just after midnight) ## ==SEE ALSO the script: ## bk ls --display all tarfiles ## bk list --display all tarfile contents ## bk list ereimer-2001 --display contents of tarfiles produced during 2001 ## bk list etc-20010[1-3] --display contents of tarfiles produced in 2001 January thru March ## tarfiles under /pix/bkup are called: ## Name-YYYYMMDD-HHMM-F|I.tgz --where Name is etc|ereimer|nsmail|beans|books|noci|er|... VRB=$1; if [ $# -eq 0 ];then VRB=full; fi ##2009-12: default to "full" case "$VRB" in full|incr) for NM in beans books debwendon erall ereimer etc flora nociall;do ##2007apr01:removed nsmail now under /pix; 2008nov:debwendon; 2010-03:flora bk $VRB $NM done ##bk-mount-copy-umount.cron ##copying to sdb6; 2009-12:YANKED echo "NEW BKUPS:" ##2009-12: added to solve the confusion, last ls by bk then these... ls -ABCGFl /pix/bkup/*-$(date +%Y%m%d)* ;; export) if [ $# -gt 1 ];then DATE=$2; else DATE=$(date +%Y%m%d); fi ##2004dec: needed when working near midnight... cd /tmp ##cat /proc/ide/ide1/hdd/settings >hdd-settings-before ##DEBUG mkisofs -v -J -o /pix/tmp.iso /pix/bkup/*-$DATE* ##note: what mkisofs calls 765MB, cdrecord calls 665MB and it FITS! echo -n "---press any key when ready (note what mkisofs calls 765MB FITS onto a CD):"; read ##==chance to interupt if mkisofs didn't work... cdrecord -v speed=16 dev=0,0,0 /pix/tmp.iso ##was default speed=8, trying speed=16 ##cat /proc/ide/ide1/hdd/settings >hdd-settings-after ##DEBUG ##diff -bBs -U0 hdd-settings-before hdd-settings-after ##DEBUG ;; *) echo "Usage: $0 full/incr/export [DATE]" exit 2 ;; esac exit CHANGE-LOG: =========== pre03sep: static dirs done at least once: arc_explorer_mapdata etc_excluded pkg wincan ##--06aug: pkg-->/pix/pkg wincan-->/pix/pkg/wincan 03sep10: static dirs done at least once: WINDOWS-ROOT-BKUP 2009-12: YANKed call to bk-mount-copy-umount.cron, both here and in copyCF -- it's now run nightly; and will also be running this script nightly, via bk-auto.cron; 2009-12: see bk-auto.cron WRT Pruning (Pruning-Needed notes used to be here);