at command to run every monday


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting at command to run every monday
# 8  
Old 04-04-2011
At my last company we used "at" for some periodic jobs. The script would re-at itself as it ran. We found that the script should re-at itself as the first thing it does in case it dies early. This was not a great solution, but it mostly worked. We did it because the user insisted that her job must run every 10 days... exactly. Running it on days 1, 11, 21 of the month (or anything like that) would not do. Exactly every 10 days. Using "at" seemed like the path of least resistance.
# 9  
Old 04-05-2011
Depending on the cron version used it might even have been possible to use it, but yeah, this proves there's always an exception to a rule. However, for something so basic as "every monday" it simpler to use cron than at IMO.
# 10  
Old 04-05-2011
Quote:
The problem is i need to schedule a script to run on 16 servers and certain servers say that cron job doesn't exist,so we were asked to use at commands instead..
Can you expand on this statement giving examples and real error messages?
Because "at" uses the "cron" daemon there is no sense in using "at" for a weekly job when a normal cron is designed for the task.
Don't forget to specify the full pathname to a script if you want to run it from cron.
# 11  
Old 05-24-2011
There are two issues i have,
1. with the cron job we do not have access to this on all the 16 servers(as per our business client)
2. i need to use at command, but it runs as scheduled jus once.

the at command, i am using is
at 0030 <$QDM_BIN_DIR/OBE_schedule.ksh

Please help me wiht this, i tried using "everyday" and "today" keywords along with at command but dint work too..
# 12  
Old 05-24-2011
My solution would be to set your script as a start up application. Through the command date it can check the day, if Monday, let it run in a loop that checks every five minutes or so the time (through the command 'date' as well), if time is 11.30+-5 then break the loop and do whatever you want
# 13  
Old 05-24-2011
I'd think this to be a very strange client requirement that you can use at, but not cron...

But as said before, it is possible to do with at, you just have to re-schedule the next run at the end of the current run.

@hakermania: That would only be effective if the system was restarted every day, or if the same user logs in every day.
# 14  
Old 05-24-2011
Quote:
Originally Posted by pludi
I'd think this to be a very strange client requirement that you can use at, but not cron...

But as said before, it is possible to do with at, you just have to re-schedule the next run at the end of the current run.

@hakermania: That would only be effective if the system was restarted every day, or if the same user logs in every day.
Yes, I took for granted this fact
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

How to use dsadm command to run command on multi lpars?

how to run a command, such as "ls -l core" from one lpar to check multi lpars if core file exist? or what way can do a command on all lpars from one lpar? Thanks (1 Reply)
Discussion started by: rainbow_bean
1 Replies

2. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

3. Shell Programming and Scripting

Get Date of Previous and next Monday

Hi, I would like to know how to get Previous Monday and Next Monday from the current date.. thanks (5 Replies)
Discussion started by: balasubramani04
5 Replies

4. Shell Programming and Scripting

Monday as first day

Hello, how can I show monday as first day of the week using cal command? I have read that it must be use -m parameter, but all I have is a display message like this: cal: option requires and argument -- 'm' Any help will be greatly appreciated Regards. (5 Replies)
Discussion started by: Godie
5 Replies

5. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

6. Shell Programming and Scripting

Is command line invocation of gnome-terminal to run more than one command possible?

Hello, I am trying to learn how to pass something more than a one-command startup for gnome-terminal. I will give an example of what I'm trying to do here: #! /bin/bash # #TODO write this for gnome and xterm USAGE=" ______________________________________________ ${0##*/} run... (0 Replies)
Discussion started by: Narnie
0 Replies

7. UNIX for Advanced & Expert Users

Crontab For First Monday Of Every Month!!

Hi, Could any one please let me know the crontab entry for scheduling a job for every first monday of the month? Thank You in advance, Sue (2 Replies)
Discussion started by: pyaranoid
2 Replies

8. UNIX for Dummies Questions & Answers

cron script -run every 2nd day of month except Monday

I know I can't schedule this in cron and would have to write a wrapper around my script and schedule it in cron ....but not sure how do to this? How do I exclude Monday if the 2nd day of the month falls on a Monday? Thanks. I tried this: 0 0 2 * 0,2-6 command And I know this doesnt... (2 Replies)
Discussion started by: newtou
2 Replies

9. UNIX for Dummies Questions & Answers

Crontab First Monday of Month only

Is there a way to setup a cronjob that will only run on the first monday of the month? (3 Replies)
Discussion started by: molonede
3 Replies
Login or Register to Ask a Question