at command to run every monday


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting at command to run every monday
# 1  
Old 04-04-2011
Question at command to run every monday

Hi,
I am currently using the below at command, to schedule the script to run at a particular time,

at 2030 today <scriptname.ksh

I would like to know on how to run it every monday at around 11.30am (IST). Please help. Thanks in advance.
# 2  
Old 04-04-2011
Hi yohasini,

you can try to set a cron job with this options:

Code:
30 20 * * 2 Script.sh # every monday at 20:30

30 11 * * 2 Script.sh # every monday at 11:30

Regards.
This User Gave Thanks to cgkmal For This Post:
# 3  
Old 04-04-2011
I had tried the cron job..it doesn't work..so had to go in with at..do u have any info on how to do it with AT command?
# 4  
Old 04-04-2011
You can try something like:
Code:
at '11    utc+    30minutes' < Script.sh #To set the first run, assuming today is monday

or

at 1130 today  < Script.sh#To set the first run, assuming today is monday

or

at 11:30am  < Script.sh #To set the first run, assuming today is monday

And then go within the script and add at the end a line to invoke the Script.sh
itself to make a periodic task, something as follow:
Code:
at now +  next week < Script.sh

or 

at 1130 + 1 week < Script.sh
    
or
at 11:30am next week < Script.sh


Hope it helps.

Regards
# 5  
Old 04-04-2011
at isn't meant for periodic scheduling, that's what cron is for. If it didn't work with cron, tell us the specific problem. Usually it's something along the lines of missing environment (cron doesn't read any of the profile scripts), missing path, incorrect assumptions about the working directory (cron will switch to a temporary path before executing your script).
This User Gave Thanks to pludi For This Post:
# 6  
Old 04-04-2011
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..
# 7  
Old 04-04-2011
cron exists on (almost) all UNIX platforms, though a user may be excluded from using it. If that's the case (you'll get an appropriate error message when running crontab -e), ask your SA to enable that user.

The problem with using at is, simply put, that you can't be sure if your script is causing a problem. With at, you'll have to re-insert the script into the execution queue everytime it finishes, successful or not. As soon as the script is ended forcefully, either by user intervention or a system failure it's out of the loop, and you'd be resposible to re-enter it, while cron does this automatically.
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