[Solved] Crontab


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [Solved] Crontab
# 1  
Old 06-03-2013
[Solved] Crontab

Hi

I need my script to run at 7:30, 7:40, 7:50 & 8:00 AM.

Defined like:

Code:
30,40,50 7,8 * * *  sh myscript.sh

But this runs even at 8:30, 8:40, 8:50 - which I don't need..

Please advise.

Last edited by Scott; 06-03-2013 at 07:46 AM.. Reason: Code tags; move thread - not a Redhat question
# 2  
Old 06-03-2013
Create two jobs.
# 3  
Old 06-03-2013
Create 2 lines: one for 7:xx and one for 8:00.

Btw.: you should use absolute paths (because of the Cron Problem Number One) and redirect stdout and stderr for cronjobs, because otherwise user "root" would get mails with the output:

Code:
30,40,50 7 * * * /bin/sh /path/to/myscript.sh 1>>/path/to/stdlog 2>>/path/to/errlog

I hope this helps.

bakunin
# 4  
Old 06-03-2013
Thanks Smilie created 2.
# 5  
Old 06-05-2013
Crontab commands

There is now a useful sandbox for experimenting with cronjob commands. Put in any combination of time/date values, get back a list of future run-times. It's at the 'Dataphyx' site.

Moderator's Comments:
Mod Comment the link is : http://www.dataphyx.com/cronsandbox/

Last edited by vbe; 06-05-2013 at 05:30 AM.. Reason: added the link the user suggested...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Crontab

Can crontab be removed from an AIX system. We had a script that was running on the system. It stopped working. An outside vendor said that crontab does not exist on the system. and that is why it is not running. How can i verify this and get it back on the systems if needed? thanks (4 Replies)
Discussion started by: fierfek
4 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Error while updating the crontab

When I update the crontab, I get error message. Any idea? 0 0-23 * * * /usr/local/scripts/monitor.sh > /dev/null ( BEFORE) */5 * * * * /usr/local/scripts/monitor.sh > /dev/null (Now) it doesn't allow me to save the work. Error message... crontab: */5 * * * *... (3 Replies)
Discussion started by: samnyc
3 Replies

3. Shell Programming and Scripting

[Solved] Shell script not working in crontab

Hi Iam running below script in crontab but its not working. #!/bin/sh cd /Scripts /usr/local/bin/expect -f /Scripts/bng_backup.exp /Scripts/data.txt tar -cf bngbackup.tar bngbackup ;gzip bngbackup.tar when iam running manually the output file is generating..but bngbackup.tar.gz file... (5 Replies)
Discussion started by: surender reddy
5 Replies

4. UNIX for Advanced & Expert Users

[Solved] Crontab not launching script

Hi all, i have the following script #!/bin/sh for i in `ps -leaf --cols 1024 | grep LogUser | grep -v grep | awk '{print $4}'`; do echo $i kill -15 $i; done; but it seems that the crontab its sciping this script,i configured corntab as following */30 * * * root... (2 Replies)
Discussion started by: charli1
2 Replies

5. UNIX for Dummies Questions & Answers

[Solved] crontab scheduling

Hi, We can schedule a new job using crontab -e. is there any other way to achieve the same(opening the file directly and add an entry). I have tried to access /var/spool/crontabs directory. But i am getting permission denied error, Please help me. Thanks (8 Replies)
Discussion started by: pandeesh
8 Replies

6. HP-UX

[Solved] crontab issue "day of week"

Is there an issue with running a cron entry like the below entries? 0 2 21 12 2 cd /usr/local/bin;./cksecurity.sh -f /home/theninja/security.dat21 I wanted this to run on Tues at 2am, which it did successfully, however I also had the following entry to run next tuesday that also ran on 12/21.... (3 Replies)
Discussion started by: theninja
3 Replies

7. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

8. Shell Programming and Scripting

crontab

Simple script that removed some files successfully as script sh -x But not working in crontab, however it fires and writes log files even some count of the files I set all env and user interaction The crontab runs in the same user where the files are there. Script: ## Set the... (11 Replies)
Discussion started by: balaji.rengaraj
11 Replies
Login or Register to Ask a Question