Hello, is it possible to schedule cron jobs using business days instead of calendar days? I need to run several jobs on first and third business days of the month. I currently have this cron-tab entry which runs every week day at 5 AM. I need to schedule the same job on the 3rd Business day of the month. Any ideas to make this happen?
Thank you.
Pramodini
Last edited by Yogesh Sawant; 12-31-2010 at 01:43 PM..
Reason: added code tags
I doubt cron will be versatile enough to schedule like this - even linux versions, but it could quite easily just call the script every day, and then you can provide the logic in the script to only run the required functionality if it meets the working day requirement.
@rdcwayx, I do not see “cal” command. @citaylor, you are right, UNIX is not that versatile. I can handle the business days logic via K-Shell script, I was trying to avoid that.
As others have pointed out, I would run a script everyday. In that script check to see if it is the day you want the script to run, if not exit.
You're only talking about 24 days a year. Create a file with the days you want the script to run. Then grep the file using today's date. If today's date is in the file, continue the script. (If not exit). It could be as simple as:
@purdym , I currently have this for not running the jobs on holidays and I plan to have a similar structure for business days as well. Before the script below runs, I have a job that checks our Corporate Holidays calendar and creates a control file using holiday_ctrl.ctrl using SAS.
if [[ -e $CTRL_FL_HOL ]] then print "Pramodini today is a holiday" print "Exiting Program" exit else print "Pramodini today is a working day" print "Execute Program" fi
Hi everyone,
recently I've been offered a selection procedure for new Barclays development center in Prague. Job role should be something like:
Barclays FX Application Management Support Analyst Job in Prague | Glassdoor
Could anyone throw me some light into what skill levels are needed, what... (3 Replies)
Hi Everybody,
I want to run a script at every 5 seconds. I know how to run it every 5 minutes, is there any possibility to run a script at 5 seconds interval.
Regards,
Mastan (3 Replies)
Could you “crontab” it to run every 10 minutes on work days (Mo - Fr) between 08:00 and 18:00
i know to run every 10 mints but can any one guide me how to achieve the above one (2 Replies)
Hi All,
I have a script which is scheduled in the Cron. It runs every 10th and 40th min of an hour.The job has to run every 30min.
But, I do not want to have the 00:10 MST run every day.Is it possible to exclude that run from the schedule?Or any other way through which i can run my job every... (4 Replies)
Hello,
I have to schedule a command to run on every 3 days. Whether the below cron entry will work?
0 3 */3 * * command
Please help me out and thanks in advance! (6 Replies)
Is there a way in AIX to schedule a script to run bi-weekly through cron?
I have a script that needs to run every other Wednesday, and this is what I thought I had to enter in the crontab file:
00 08 * * 3/2 /home/user/user.script
It didn't like that. It reports a syntax error. I'm almost... (5 Replies)
hello there,
i'm learning about task scheduling with cron and all seems hyper exciting, yeppie. But there is a prob:
assume i have a script that needed to be executed at 7am everyday. I could do:
vi mycron
00 7 * * * echo hi mother, i wanna be a script daddy.
:wq
crontab mycron
how... (4 Replies)