Re: Making System Back-Ups
hi ya
"is there a better backup solution" was the posters original question..
vs tape backup....
-- i think tape backups are too slow, too old and too cumbersome..
( my opinion )
-- i think a backup system should be able to restore a suystem within
1hr of the disk "being erased/or system went down"...
-- backup systems usually fail... due to one or more reasons..
- old tapes -- ( lets ignore all tape issues )
- bad network/flaky network
- out of disk space
- bad setup that root protected files were not backed up
- operator error
- cron died
-- you dont want to be doing backups nightly and not test it/check it...
- dont wait till the real disk actually crashes to find out
-- usually when a incremental backup fails...( say tuesday ). all
subsequent backups are useless ... since all of tuesday's changes will
be missing
-- a better backup strategy...
- backup files from the last full backup...
- make sure you have multiple paths to recreate "said full backup"
have fun
alvin
my itty bitty script that was posted previously....
( can also be used to mirror systemA to systemB...
lets assume /Backup is a different disk ( same PC or NFS mounted disk )
in cron... ( crontab -e )
# Daily Incremental..
1 01 * * * /usr/scripts/Backup.pl
# Weekly incremental
# on Sat
1 01 * * 6 /usr/scripts/Backup.pl -inc32
#
# on Sunday
1 02 * * 0 /usr/scripts/Backup.pl -full
# Monthly full too ???
# 01 0 1 * * /usr/scripts/Backup.pl -full -dir ....stuff ...
where Backup.pl ( quickie psuedo code )
#!/usr/bin/perl
#
# quickie...untested itty-bitty backup psudeo code ...we'll ignore bad
code practices here...
#
#
# this can be passed in as a variable if needed...
my ( $DIR ) = "/root /etc /var/log /home/";
#
my ( $Exclude ) = ".netscape/cache"; # throw this away
#
#
` mount /Backup ; cd /Backup`; # if not automounting - lock it down...
#
my ( $cnt ) = `cat /Backup/cnt.txt`;
$cnt = "32" if ( $ARGV[0] eq "-inc32" );
#
#
my ( $period ) = "-mtime $cnt";
#
$period = "" if ( $ARGV[0] eq "-full" );
#
#
my ( @date ) = split ( /\s+/, `date` ); # Wed Jan 03 00:55:58 PST 2001
my ( $Mon ) = $date[1];
my ( $Date ) = sprintf "%02d", $date[2];
#
#
#
` mkdir /Backup/$Mon ` if ( ! -d "/Backup/$Mon" );
#
#
# =========================
# primary line of interest
# =========================
#
` find $DIR $period -type f -print | egrep -v $Exclude | tar zcvf
/Backup/$Mon/${Date}.${cnt}.tgz -T - `;
#
#
$cnt += 1;
$cnt = 2 if ( $ARGV[0] eq "-full" ); # reset incremental counter since
full backup
` echo $cnt > /Backup/cnt.txt `;
#
#
` cd /tmp ; umount /Backup `; # done
#
# end of file
On Wed, 17 Jan 2001 kmself@ix.netcom.com wrote:
> on Wed, Jan 17, 2001 at 08:26:48AM +0100, <anonymous> wrote:
> > (private reply)
>
> Respondee redacted, response to list.
>
> >
> > On Tue, 16 Jan 2001 13:51:36 PST, kmself@ix.netcom.com writes:
> > > http://kmself.home.netcom.com/Linux/FAQs/backups.html
> >
> > I´d slightly extend your script and think that that may be good to
> > include, for people not very familiar with the tools used:
> >
> > -----
> > backupdirs="/bin /boot /etc /initrd /lib /opt /root /sbin /usr /var"
> ^^^^ ^^^^^^^ ^^^^ ^^^^^ ^^^^
> See the referenced document as to why it may be unnecessary (and perhaps
> unwise) to archive system directories which can readily be restored from
> installation media or via apt-get.
>
> > excludirs="/var/cache/apt/ /var/log/ /var/tmp/ /var/run/ \
> > /home/waldner/pics"
> > cat /dev/null >/tmp/backup.exclude
> >
> > # build list of files to exclude
> >
> > for path in $excludirs
> > do
> > echo "Building list of files to exclude for " -n
> > find $path 1>>/tmp/backup.exclude || exit 1
> > echo "done."
> > sleep 2
> > done
> >
> > echo "Exclude-List built."
> > echo " "
> >
> > for path in $backupdirs
> > do
> > echo "System backup on $path " -n
> > tar -X /tmp/backup.exclude cIvf /dev/nst0 $path \
> > 1>>/tmp/backup.log || exit 1
> > echo "done."
> > sleep 2
> > done
> > -----
>
> Yes, you can use find for backups. I find (pun noted) my own mechanisms
> sufficient. 'find' may produce problems with filenames containing
> embedded blanks, haven't checked this myself. You may wish to
> investigate.
>
> --
> Karsten M. Self <kmself@ix.netcom.com> http://kmself.home.netcom.com/
> What part of "Gestalt" don't you understand? There is no K5 cabal
> http://gestalt-system.sourceforge.net/ http://www.kuro5hin.org
>
Reply to: