var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: crontab question #2
I'd like to do the following:
- Schedule daily backups during Jan-Apr
- Schedule weekly backups during May-Dec
Backups will be scheduled in crontab.
Is it possible to write a script similar to is_dow posted here [ http://www.dbforums.com/unix-shell-s...-question.html ] that will determine the current month and decide if the job should be run daily or weekly?
What I can do is to create a file with the required crontab entries and schedule a job to run "crontab <file>" on Jan 1st (with daily backups, etc..) and May 1st (with weekly backups, etc..). This seems to work ok, but I'd like to know if there is a better way to accomplish this?
This is the script that crontab calls every day.
This is the daily backup
if [ $this_month -le 4 ]
This is the weekly backup
copy all files to tape
#do weekly backup
today=`date +%u` #monday is 1, sunday is 7
if [ $today -eq "the day I want to do the backup" ]
copy files to tape
echo "not today"
Last edited by kitaman; 08-03-12 at