Simulate CRON job


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Simulate CRON job
# 1  
Old 05-12-2010
Simulate CRON job

Does anyone know how I can simulate a cron job execution via UNIX scripting or is there a command/tool that simulate this?

I have a file I called "appSchedule.txt", it contains below lines:

Code:
00 03 * * 1-6   RED  start
00 06 * * 0     RED  start
00 21 * * *     RED stop

00 03 * * 1-6   BLUE  start
00 06 * * 0     BLUE  start
00 21 * * *     BLUE  stop

If you noticed, it like a cron entries. What I need is for my script to output only (when I execute the script at any time/date) the the color that is scheduled to run based on the schedule given for it in the appSchedule.txt file. Just like what cron does, it executes only the lines that matches the schedule on it versus the current system time/date. Can anyone help me with the scripting for that?
# 2  
Old 05-12-2010
IMHO a total waste of time writing such an application in Shell. Such a program should be a daemon (like cron).
There are many commercial or shareware job scheduler suites available but omitting to mention anything about your computer does limit the reply options to none.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

3. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

4. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

5. AIX

Help with cron job

Hi guys and gals, I have this script that run perfectly when executed manually. If I place it in a cron to run on a schedule, it fails. Error is: exec(): 0509-036 Cannot load program /usr/local/bin/getlogical because of the following errors: 0509-150 Dependent module... (7 Replies)
Discussion started by: bbbngowc
7 Replies

6. UNIX and Linux Applications

Help regarding a cron job

Hi, I need to write cron job, which tries to build a project. It would check out code from a repository and then will attempt to build it .The results of the build would show up on a web-page (a table with rows, one for each build, should get updated; a link to the detailed log file; color green... (3 Replies)
Discussion started by: sat411
3 Replies

7. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

8. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

9. UNIX for Advanced & Expert Users

cron job

Hi, Anyone please let me know how to add an entry for crontab while there are few of entries already in. When I execute crontab -e, the entries which are added already are displayed. But, I need to add one more entry to the crontab and then after that I need to remove the entry without... (1 Reply)
Discussion started by: minar
1 Replies

10. Shell Programming and Scripting

cron job

Hi Gurus I need to add a new cronjob to a list. There are already 7-8 cronjobs when I do crontab -e. I need to add a new cronjob without disturbing the existing ones. Can you please tell me how to do that. I am not so good in vi editor as well, but I can do it with some guidance. this is urgent,... (3 Replies)
Discussion started by: ragha81
3 Replies
Login or Register to Ask a Question