[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] Re: Backup advice



Alex

> I'll try it and let you know how I get on.  Presumably I can run
> this from /etc/crontab ?

I've put this into /usr/bin as a file called backup..

#!/bin/sh
rsync -a /home/mydocs/  /home/richard/ > /dev/null 2>&1
mkdir -p /tmp/backup
export FILE=3Dbackup-`date +%Y%m%d`.tgz
tar -cz /home/richard > /tmp/mybackup/$FILE
mkisofs -r -J -o /tmp/backup.iso /tmp/backup
# cdrecord -v speed=3D2 dev=3D0,1,0 blank=3Dfast
cdrecord -v speed=3D2 dev=3D0,1,0 -data /tmp/backup.iso
rm -rf /tmp/backup /tmp/backup.iso

and done 'chmod +x backup'.   Thing that I'm still wondering about is 
the bit about "/tmp/mybackup/$FILE" in the script.  Shouldn't 
mybackup read as something else ?  Also the crontab looks like this 
...

14 0  	* * * 	root   /usr/bin/backup


to make a daily backup.   Is that correct or am I just completely 
wrong here ?

Thanks


-- 
Richard
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.