From 109d5e46a35ba3c1790fe5bbcd37b920f48b09cd Mon Sep 17 00:00:00 2001 From: Carl N Baldwin Date: Tue, 25 Oct 2005 10:32:59 -0600 Subject: [PATCH] Reorganize the drive script --- scripts/drive.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/scripts/drive.sh b/scripts/drive.sh index 63ac79c..6ea91a6 100755 --- a/scripts/drive.sh +++ b/scripts/drive.sh @@ -3,27 +3,15 @@ scriptsdir=$(dirname $0) bindir="$scriptsdir/../build" -datadir="/var/lib/backups" -tmpdir="/dev/shm/backups" - -mkdir -p $tmpdir -chmod 700 $tmpdir - export PATH=$scriptsdir:$bindir:$PATH -files="$tmpdir/files.db" -touch $files -chmod 600 $files -echo "Running find to get the status of files" -find-cmd.sh /home > $files - -db="$datadir/backups.db" +# file locations and other values +datadir="/var/lib/backups" +tmpdir="/dev/shm/backups" +currentfiles="$tmpdir/files.db" +backupdb="$datadir/backups.db" backups="$tmpdir/backup-list.db" statusfile="$tmpdir/backup-status.txt" - -echo "Determining list of files to backup with lsbackups" -cat $files | lsbackups > $backups 2>$statusfile - isomountdir="/backup/iso-mount" isoimage="/backup/iso-mount.iso" @@ -39,11 +27,22 @@ echo "Mounting the iso image" # Mount iso image here mount -t ext2 -o loop $isoimage $isomountdir +mkdir -p $tmpdir +chmod 700 $tmpdir + +touch $currentfiles +chmod 600 $currentfiles +echo "Running find to get the status of files" +find-cmd.sh /home > $currentfiles + +echo "Determining list of files to backup with lsbackups" +cat $currentfiles | lsbackups > $backups 2>$statusfile + echo "Running rsync to pack the image" cat $backups | rsync-cmd.sh $isomountdir echo "Copying over database and status file" -cp $statusfile $db $isomountdir +cp $statusfile $backupdb $isomountdir # umount $isomountdir -- 2.34.1