Crontab update


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab update
# 15  
Old 04-29-2018
Slight difference with cron running a script and having x cron jobs is that the latter will run all the jobs simultaneously while the former has them being run sequentially. My guess is that these are fairly low resource jobs and will complete very quickly, so the distinction may be minimal.

Here is an idea for the contents of this script file.

/path/to/script
Code:
SKIP_COUNTRIES="gb mx"
ALL_COUNTRIES="us mx gb cn ge"

. /u/data/environment
export ENV=prod

for COUNTRY in ${ALL_COUNTRIES}
do
    for SKIP in ${SKIP_COUNTRIES}
    do
        [ ${COUNTRY} = "${SKIP}" ] && continue 2
    done
    /u/application/pkms/startStoppry.sh ${COUNTRY} kreight v1 monitor >> /u/application/grpms/${COUNTRY}/logs/kreight/v1/startkreight.out 2>&1
done

You can then either use vi to update the SKIP_COUNTRIES setting, or write an automated update using sed (or whatever) SKIP_COUNTRIES could even be read from a file, you have many options here...
# 16  
Old 04-29-2018
Quote:
Originally Posted by Don Cragun
As hicksdb8 mentioned, if you directly edit the user's crontab file in place not using crontab -e and not using crontab file, the changes might not be noticed by cron until the next time you reboot or stop and restart cron.
At least for AIX it is easy: do the changes directly to the crontab (they are located in /var/spool/cron/crontab/<username>), find out crons PID and send a kill -1 <PID>. That will make it reread its configuration (as any UNIX program should act upon receiving signal 1).

If this is too fancy for your liking here is a more brutal approach: you can just kill cron. As it is started from /etc/inittab with the restart clause the system will restart it for you once it doesn't run any more.

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

How to update Solaris 10 Update 3 to Update 11?

Hi friends, We have a Solaris machine running 10 update 3 -bash-3.2# cat /etc/release Solaris 10 11/06 s10s_u3wos_10 SPARC Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. ... (6 Replies)
Discussion started by: prvnrk
6 Replies

2. Red Hat

RedHat 5 update 9 BASH update issue

Hi i want to update the BASH because of the "shell shock" vulnerability. my RedHat 5 is clean install with the default mirror site. when im running the command: yum update bash im getting a message saying there is no update. you can see in the attach picture... what am i doing wrong? is... (4 Replies)
Discussion started by: guy3145
4 Replies

3. Programming

MYSQL - trigger update on record insert or update

Right I have a MYSQL database with table1 with 3 columns, colA, colB and colC. I want to combine the data in the 3 columns into a 4th column names col_comb. Here's the SQL command that works: UPDATE table1 SET `col_comb` = CONCAT( `colA` , ' - ', `colB` , ', ', `colC` ); So now I want this... (5 Replies)
Discussion started by: barrydocks
5 Replies

4. Solaris

Is it possible to "upgrade" Sol10 update 9 to update 10?

Is it possible to "upgrade" Sol10 update 9 to update 10 by booting from the DVD? I had never even tried this until a user asked me to do it, so i tried and it just hung there after the part where it reads the rules.ok file. Is this even possible to upgrade? or does it have to be a new install. ... (5 Replies)
Discussion started by: BG_JrAdmin
5 Replies

5. Solaris

Install update 6 on solaris with update 3

I want to update my solaris 10 server which is currently on update 3 stage. A new application require it to be on update 6. What is the best way to make it update 6. should i just install the patch or should i go for the liveupgrade?? thanks for you help in advance (3 Replies)
Discussion started by: uxravi
3 Replies

6. UNIX for Dummies Questions & Answers

How to get the last crontab

Hi all, can anybody tell how to get the last crontab if it is deleted. is there any way to get the crontab back? or it will it be staored anywhere ? its very urgent, can anybody help for the same? Thanks, Vinay (5 Replies)
Discussion started by: vinayakatj56
5 Replies

7. UNIX for Advanced & Expert Users

Pro*C Update not working from Crontab

Dear All, I have writen a Pro*c program that does a data base select,insert,update statements and I have scheduled the program to run from crontab, It is runing fine for the select insert and commit statement till it reaches the update statement , it throws the following error: SQL On IPB... (2 Replies)
Discussion started by: alhallay
2 Replies

8. UNIX for Dummies Questions & Answers

UNIX "Crontab update"

Is there another location to update a cron that's run daily. I have updated the root cron located "/var/spool/cron/crontabs " After the update the cron doesn't run at the new time it was set at. It continues to run at the old time. Checking the root cron after it has been updated show the... (3 Replies)
Discussion started by: ddrivera
3 Replies

9. Solaris

Unable to update the Crontab

Hi Everyone, Each time I do update the crontab, it gets reset after exiting from the telnet session. I'm using Solaris 2.8 So it goes like this: Step 1: Login as root, from a telnet session Step 2: Crontab -e (I make modification) Step 3: Save and exit Step 4: Type crontab -l , changes... (4 Replies)
Discussion started by: Jeremy3
4 Replies
Login or Register to Ask a Question