PDA

View Full Version : Crontab manager...Plz Help!


chosend
2004-10-01, 14:47 PM
I'm paying for a 2 hard drive server and I have not used the second hard drive at all. i don't know how to back up my files onto the second drive. I was told that I can use crontab manager commands to do this. I have Putty but I don't know programming or Linux so I wouldn't know how to back up the files. If somebody can help me step by step how to do this I would gladly appreciate it. :confused:

markm
2004-10-01, 15:34 PM
The first thing that you want to do is make a backup script.

something like

#!/bin/sh
tar -cf - /good/stuff |bzip2 >/backup/file.tar.bz2

Would do the trick.

Save that file somewhere and 'chmod +x' the file.

So lets say that I saved my backup script to backup.sh in my home directory, and I want it to run at 7:10 am every day. I would run 'crontab -e' and add a line in like:

10 07 * * * ~/backup.sh


I hope that is good enough to get you started.

chosend
2004-10-01, 15:40 PM
Thanks. But where do I insert this backup script?..I'm sorry but i really don't know anything about this so i'm sorry if i sound extremely dumb. Do i insert this on plesk or do i have to open putty and do it through there?

fastduke
2004-10-04, 10:51 AM
# Minute[0-59] Hour[0-23] Day[1-31] Month[1-12] Weekday[0-6] /path/to/script or command

#!/bin/sh
tar -cf - /good/stuff |bzip2 >/backup/file.tar.bz2 <-- This is located in the file /backup.sh

and

10 07 * * * ~/backup.sh <-- this tells crond to run it at 7:10am everyday.

If you are not familiar with vi then I suggest you login to your server via ssh(putty) and issue this command: vimtutor