LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Every sunday running difference backup job. (https://www.linuxquestions.org/questions/linux-server-73/every-sunday-running-difference-backup-job-549929/)

kwingng 04-29-2007 10:35 AM

Every sunday running difference backup job.
 
Hi there, I would like to find out, how can I run a difference backup job on every sunday?
Let say, week 1 sunday I need to backup server A and B.
Week 2 sunday backup server C and D.
week 3 back to week 1 schedule backuping up server A nad B so and so on.

I there any way to do so?

PatrickNew 04-29-2007 11:23 AM

Sure you can. You'll just need to write a script that performs the backup, and set it up as a cron job. You can have a simple text file, which the script will read, and in that text file, your can store the number of the week. Then after the backup is done, the script writes in the number of the next week.

kwingng 05-01-2007 10:01 AM

#!/bin/sh
d=`date +%d`
m=`expr \( $d - 1 \) / 7`
case $m in
0) echo "1st week in this month";; #<<<<<<<
1) echo "2nd week";;
2) echo "3rd week";;
3) echo "4th week";;
4) echo "5th week";;

esac


does it help?


All times are GMT -5. The time now is 08:52 PM.