LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cron job - backup (https://www.linuxquestions.org/questions/linux-newbie-8/cron-job-backup-21595/)

medamnit 05-22-2002 08:42 PM

cron job - backup
 
Hi,

I've been searching about cron jobs lately and trying to work out how to perform an automate of the backup.

like how would i automatically backup the '/root' every night (8pm)

any help or directions would be great.

Thanks
medamnit

piranha 05-23-2002 02:33 AM

Use webmin to create a cron job (System -> Scheduled Cron Jobs). It's very easy.

medamnit 05-23-2002 11:38 AM

cool, got the cron jobs down. but backup is little confusing.
read about basic command 'dump'.
any other options?

i'm trying to backup 2 files to floppy. any ideas?
also read recommend umount before backup. so would u umount your hd before backup?

thanks
medamnit

hanzerik 05-23-2002 11:55 AM

Well if its just 2 files that fit on a floppy:

make a script I'll call this floppy-bak containing:

#!/bin/bash
mount -t vfat /dev/fd0 /mnt/floppy
cd /root
cp filename1 filename2 /mnt/floppy
umount /dev/fd0

make it executable: chmod 744 floppy-bak

make a cron job to run the script
crontab -e
0 20 * * * /path/to/floppy-bak

you can put the script in /usr/sbin

You will need to have a floppy in the drive before this is run.

saavik 05-24-2002 03:37 AM

hello!
 
i woud not suggest to use webmin!
it is very much depending on what distrbution you are using.
And so i made the experience that somethimes everything in webmin looks find but isn`t really working.


All times are GMT -5. The time now is 09:20 PM.