LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to make a scheduled backup procedure using the cron file? (http://www.linuxquestions.org/questions/linux-networking-3/how-to-make-a-scheduled-backup-procedure-using-the-cron-file-411754/)

mus1402 02-04-2006 09:48 PM

How to make a scheduled backup procedure using the cron file?
 
Does anyone here know how to make a scheduled backup procedure using the cron file?

Please tell me as soon as possible.

Thanks in advance.

card-suse 02-04-2006 10:51 PM

It's pretty straightforward. You simply write a bash script (or whatever shell flavor you like) to do the backups (either tar or dar commands). Then create a scheduled crontab event using:

Code:

crontab -e
I'm assuming you know how to input the lines in crontab. Here's an example from mine:

Code:

5 0-23/1 * * * /usr/local/bin/backup-full.sh /backup/users .users-backup 5 >> $HOME/backup-users-weekly.err 2>&1
This line runs my backup-full.sh script every hour at 5 minutes past the hour. Your scripts can be as simple or complicated as you like. Mine are a little complicated in that they look for hotplug events to migrate my backups and do checks to see when the last backup was performed and such. That's why I installed them to run every hour since they are on my laptop and it's not always powered on. So I let the scripts do all the checking instead of relying on my computer being powered on at the appropriate times. A place to check for some simple backup scripts is: http://www.linux-backup.net

Hope this helps.


All times are GMT -5. The time now is 07:29 AM.