How to Disabling cron for few hours each day


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to Disabling cron for few hours each day
# 1  
Old 10-16-2012
How to Disabling cron for few hours each day

Hi

Is there any way to disable cron adhoc ?

I want to run a script for every one minute between 04 to 00 hours

will the below serves my purpose ?
Code:
01 04-00 * * * <your script>

# 2  
Old 10-16-2012
That is from 4:00am to midnight
try:
Code:
# one way
* 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * *  /path/to/my/script
#another way
* * * * *  [ `/usr/bin/date +%H` -gt 3 ] && /path/to/my/script

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

AIX cron job is running everyday instead of on a particular day

Hello, I was trying to run a script on a dev server using cron job. It supposed to run 3rd sunday of every month. 45 4 15-21 * 0 /home/user1/myscript.sh >/dev/null 2>&1 # run this script 3rd sunday of every month When I Schedule it on AIX server, It is running every day at 4:45 AM. am I... (3 Replies)
Discussion started by: Kumar7997
3 Replies

2. Solaris

How to run cron entry every 5 min during office hours only?

Hi I need to setuop a cron entry to run every 5 min, only in office hours (between 8:00AM to 18:00PM, I did the following: 0,5,10,15,20,25,30,35,40,45,50,55 8,9,10,11,12,13,14,15,16,17,18 * * * /home/xxx/zzz.ksh But somehow does not work. Could it be wrong? (8 Replies)
Discussion started by: fretagi
8 Replies

3. AIX

Disabling cron after NIM restore

Hi Guys, We normally have a backup and restore nightly on our Prod machines. We do this via customized script and all unattended. The dilemma that I'm having is the disabling of the cron after the restore. I created a nim script to disable the cron after the restore has been completed. But... (6 Replies)
Discussion started by: kaelu26
6 Replies

4. Shell Programming and Scripting

Disabling and enabling the cron

Hi All, Please tell me what is command to disable and enable the cron in unix. Thanks in Advance. Regards, Sindu (5 Replies)
Discussion started by: indira_s
5 Replies

5. AIX

cron off by 5 hours

stupid question im sure, but its frustrating My cron jobs are off by 5 hours. My system time is right but all of my cron jobs are running approximately 5 hours late. Any idea why? (4 Replies)
Discussion started by: mshilling
4 Replies

6. Shell Programming and Scripting

Cron job randomly once a day

I want to create a cron job randomly once a day for my site's registration. The responsible file for registrations is a config file and I need to change the contents twice on day (on and off) I know the way for random cron job for example */n * * * * /usr/local/bin/php... (6 Replies)
Discussion started by: lucker
6 Replies

7. Shell Programming and Scripting

Cron job for every five minutes and between hours

Hi I need to run a script every five minutes and it should run between 07-15 hours all days. How i can achieve this... i tried like this */5 07-15 * * * /scripts/CreateFtpData.sh It throws an error... (1 Reply)
Discussion started by: aemunathan
1 Replies

8. Shell Programming and Scripting

Write a script to send alert for some particular hours in a day

Hi All, I have a have a script which checks for some processes whether they are running or not and if they are not running then it send a mail specifying that the processes are not running. This particular script example abc.ksh is runs in a cron like this 0,5,10,15,20,25,30,35,40,45,50,55 * * *... (5 Replies)
Discussion started by: usha rao
5 Replies

9. 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

10. Shell Programming and Scripting

Difference in day-hours-minutes-seconds format

Hi experts, I am reading two log files and passing dates as output to a txt file. Code is given below: echo "Start Time:" >> Report.txt cat start.log | while read LINE1 do echo $DATE1 >> Report.txt done echo "End Time:" >> Report.txt cat end.log | while read LINE2 ... (7 Replies)
Discussion started by: Sreejith_VK
7 Replies
Login or Register to Ask a Question