On 4/24/07, Ian Dexter R. Marquez <[EMAIL PROTECTED]> wrote:

Hi, Jan:

The proof of the pudding is in the eating. ;) You'd have to test the
script first, preferably in a nondestructive way.

What I usually do is set up some mock directories, add some files and
test the backup script.

Looking at your script, since you're doing the backup locally, there's
no need for the [EMAIL PROTECTED]: variables. There's also a
syntax error in the $OPTS variable:

> -backup-dir=$BACKUP_HOME/$BACKUPDIR -av"

should be

--backup-dir= ...

Note the two leading dashes.

It's also a good thing to set up all your variables at the start of
the script. Call me an O.C. but here's what I would do:

<script>
#!/bin/sh

SRCDIR=/home/d3m/source
BAKHOME=/home/d3m/backup
BAKDIR=`date +%A`
LOGDIR=/home/d3m/log
TMPDIR=/home/d3m/tmp
OPTS="-av --force --ignore-errors --delete --backup
--backup-dir=$BAKHOME/$BAKDIR"
RSYNC=/usr/bin/rsync

# Start
date > $LOGDIR/backup.$BAKDIR.log

# Cleanup
[ -d $TMPDIR ] || mkdir $TMPDIR
$RSYNC --delete -a $TMPDIR $BAKHOME/$BAKDIR
rm -rf $TMPDIR

# Backup
$RSYNC $OPTS $SRCDIR $BAKHOME/current >> $LOGDIR/backup.$BAKDIR.log

exit 0
</script>


ian,

i made some changes to your script to suit our current setup and as of this
writing i now have Wed and Thu in the log, however i have another question
though, is the script you gave me a 7 day incremental backup or is it
continuously making an incremental backup without any rotation?

tia,

jan

scenario is that the /home directory will be backed up using an external
> hard drive attached to the local machine. i already formatted this drive
and
> named the partition /backup, however i did not auto mount it using
fstab, is
> it advisable to auto mount it?

Provided that it is attached to the box, you can just mount it using
the script, then unmount it afterwards. Quite useless if it's always
attached, but safe nevertheless.

Hope these help. Good luck with the script.

--
Ian Dexter R. Marquez
http://iandexter.net | [EMAIL PROTECTED]
http://feeds.feedburner.com/Coredump
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to