Click to See Complete Forum and Search --> : Using cron to backup files


dpipper
12-13-2000, 03:15 PM
I am using the following script to backup my home dir from RH 6 box to my networked Win98 machine.

#!/bin/bash
# backup shell script for cronjob
# created Wed Dec 13 09:20:18 2000
location=/home/
backuplocation=/mnt/win_d/temp
today=`date +%Y%m%d`
#tar/gzip and copy the files to the storage drive on Windows
tar cvfz ${backuplocation}/home_${today}.tar.gz ${location}

How can I add that to the cron.weekly? Also, what can I do to get the script to only update the files that have changed in the last week?

Thanks
dpipper

ndogg
12-13-2000, 05:47 PM
As far as adding it to cron.weekly, you can use KDE's kcron utility, or just place a link to the script into /etc/cron.weekly (cron every week, just executes in numeric/alphabetic order). I would suggest using kcron, it has a very nice interface so that you don't have to work with the dirty cron directories and files.

As far as backing up only recently modified files, your best bet would be to use perl, but I wouldn't know how to do that.

------------------
Too much Sun can give you cancer. Windows break too easily.
Apples/Macintoshes can rot. BSD... sounds too much like LSD.
Penguins are the only animals sophisticated enough to wear a
tuxedo.


Linux, the only one with the Penguin.


http://ndogg.n3.net