1827862 Members
1557 Online
109969 Solutions
New Discussion

resolutino of crontab

 
SOLVED
Go to solution
Tonatiuh
Super Advisor

resolutino of crontab

minimal lapse of time in crontab is the minute. How can I change this behavior to 5 seconds or 10 seconds?
4 REPLIES 4
NiCK_76
Respected Contributor
Solution

Re: resolutino of crontab

Hi Tonatiuh ,

Why you need set crontab cycle use seconds? What do you want?

for 5 minutes
*/5 * * * * /path/command
for 10 minutes
*/10 * * * * /path/command

NiCK
just for fun
Thierry Poels_1
Honored Contributor

Re: resolutino of crontab

Hi,

crontab is triggered on the minute. No way around that.

If want a job to be launched quicker then just keep it running in a loop with sleep statements in between if required.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Sergejs Svitnevs
Honored Contributor

Re: resolutino of crontab

If you want to run the command every 5
seconds, try a script:

while true
do

sleep 5
done


Regards,
Sergejs
Thomas Bianco
Honored Contributor

Re: resolutino of crontab

this is the second message i've seen from you on this, and i'm starting to get worried about what you're tring to do.

doing something 12 times a minute is generally poor planning. there is usually an easier way to fix your root cause.

judging from your two posts, you're trying to prevent a program from changing a file by coping it from a known good source every 5-10 seconds.

have you considered changing the permissions to prevent writing to the file? this would be simpler, and wouldn't clog your file system buffers or put undo stress on your hard drives.
There have been Innumerable people who have helped me. Of course, I've managed to piss most of them off.