crontab to run every 20 second


 
Thread Tools Search this Thread
Operating Systems Solaris crontab to run every 20 second
# 1  
Old 12-23-2008
crontab to run every 20 second

Hi experts,

I want to set the crontab for my script which will run every 20 seconds

I think below could be the possible one-

*/3 * * * * /export/home/username/scripts/runing.sh


As my system(SOLARIS 9) is live- i am confused to implement before make sure !!!

I need your suggestion.


//purple
# 2  
Old 12-23-2008
No, it won't, instead it will run every 3 minutes (* == At any minute, /3 == every 3, */3 every 3 minutes, no matter what minute). AFAIK it's not possible to create a crontab entry for anything less than every minute.
If you really need to run something every 20 seconds, rather write a script that backgrounds and starts the desired action in a loop (using sleep or something alike).

HTH
# 3  
Old 12-23-2008
Quote:
Originally Posted by pludi
No, it won't, instead it will run every 3 minutes (* == At any minute, /3 == every 3, */3 every 3 minutes, no matter what minute). AFAIK it's not possible to create a crontab entry for anything less than every minute.
If you really need to run something every 20 seconds, rather write a script that backgrounds and starts the desired action in a loop (using sleep or something alike).

HTH
So, its not possible to run every 20 second in SunSolaris. Well I now plan to to define it every 1 minute.

* * * * /export/home/username/script/running.sh

Above is okay for 1 minute interval right??
# 4  
Old 12-23-2008
Yes, that would run your script every minute. But I would still advise that any activity that has to run in such short intervals should rather be implemented as some kind of daemon (or daemon-like script), rather than be invoked by cron.
# 5  
Old 12-24-2008
Hi Pludi,

Many thanks for your advise. I am interested to take your suggestion to run my script using any daemon-like script.

As you said- write a script that backgrounds and starts the desired action in a loop.

Could you please help me on this to write the script??
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can't get my crontab to run

I'm trying to get a crontab to run, every Friday at 11am and the problem is that it isn't running at all. 0 11 * * 6 /Users/martinb/Documents/SYSADMIN/Regular-Scripts/Info-And-Backups.sh Here's a link to a screenshot of my script (I've censored my email address). Screen Shot 2017 11 03... (3 Replies)
Discussion started by: $shell_Learner
3 Replies

2. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

3. HP-UX

Crontab do not run on PM hours

Hi All I have a problem, I wonder if you can help me sort it out: I have the following entry in the cron: 00 1,13 * * * /home/report/opn_amt_gestores_credito.ksh > opn_amt_gestores_credito.log But the entry only runs at 01:07 I have stopped the cron deamon, and started, but it still... (39 Replies)
Discussion started by: fretagi
39 Replies

4. Shell Programming and Scripting

Different output when run from crontab

Hi, I have a script which checks to see if an app is running and will restart it if it is not. For some reason when I run it from the crontab it always says it is not running. The script is as follows: - #!/bin/sh # # The following script will look for the PID of SickBeard and output... (15 Replies)
Discussion started by: simpic
15 Replies

5. Shell Programming and Scripting

crontab fails to run script

OS is Ubuntu 8.04.3. When I run the command: /usr/bin/syslogMailer < /etc/syslog.pipes/criticalMessagesFrom a bash shell it works and i receive an email as per the script however when run from crontab it does not work. Can anyone explain why and how to fix it? /usr/bin/syslogMailer... (4 Replies)
Discussion started by: jelloir
4 Replies

6. Shell Programming and Scripting

Crontab job to run every sunday

Hello, I wanted to run one of my shell script for every sunday at 5PM. Here is the crontab entry i am using.. 00 17 * * 0 /inventory/update.sh > /inventory/update.log 2>&1 The job is not kicking on sunday at the specified time.. Am i missing anthing? Any help is appreciated... (2 Replies)
Discussion started by: govindts
2 Replies

7. UNIX for Advanced & Expert Users

CRONTAB does not run since reboot

Hi, we reboot our Linux server yesterday and since then (specialy last night) no job from crontab has run. Any idea ? What should I look for to investigate? Many thanks. (5 Replies)
Discussion started by: big123456
5 Replies

8. HP-UX

Run crontab every 6 days

Hi all, I need to run a shell script every 6 days using crontab. I've been searching a bit and found the following syntax for this: * * */6 * * /apps/temp/maxx.sh > /apps/temp/maxx.log 2>&1 respectively * * 0/6 * * /apps/temp/maxx.sh > /apps/temp/maxx.log 2>& Unfortunately when trying to... (8 Replies)
Discussion started by: Endo
8 Replies

9. UNIX for Advanced & Expert Users

crontab couldn't run through, help

I have created two scripts to call SQL scripts to do some work. The scripts was successfully executed many times by manual. When I scheduled two scripts in crontab, I gave all necessary parameters. It could start, but couldn't run through. The log file didn't give enough error info. Anyone can help... (10 Replies)
Discussion started by: duke0001
10 Replies

10. Shell Programming and Scripting

output from crontab run

Hi, I am trying to schedule a job in linux through the crontab command.My script actually does some text processing and echoes some output.My cron scheduler is working fine,but the output messages(echoes from script) is mailed to my mail account(in unix -/var/local/mail).Is it not possible... (0 Replies)
Discussion started by: DILEEP410
0 Replies
Login or Register to Ask a Question