Does exist some as cron, but for 10-30sec on box ? Cron is for t > 1minute. I want not create plugin, it is for e1.
some as cron but for 10-30s
Re: some as cron but for 10-30s #2
Re: some as cron but for 10-30s #3
Re: some as cron but for 10-30s #4
Re: some as cron but for 10-30s #5
Posted 10 February 2016 - 18:41
Or use while [ 1 ] instead. Depends on whether [ and/or true is a shell builtin to select which to use ;)
* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.
Re: some as cron but for 10-30s #6
Re: some as cron but for 10-30s #7
Re: some as cron but for 10-30s #8
Posted 11 February 2016 - 11:22
No don't do that. Make the sleep as long as possible. The sleep command maps 1:1 to a kernel call (probably pause()+alarm()) and the Linux kernel can deal very efficiently with processes in such "suspended" states. It just won't run for the specified amount of time. The only thing is that will have to be checked by the scheduler frequently, but the scheduler will have to do that for about 100 other processes and threads anyway, so it won't really matter.
* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.
Re: some as cron but for 10-30s #9
Posted 16 February 2016 - 01:51
this works a treat
edit to suit
/usr/script/15sec.sh
#!/bin/bash #This script run every 15 seconds while (sleep 15 && touch abc.txt) & do wait $! done
start the script via softcam
/etc/init.d/softcam.15sec
#!/bin/sh case "$1" in start) ulimit -s 512 exec start-stop-daemon -S -x /usr/script/15sec.sh & ;; stop) exec start-stop-daemon -K -R 2 -x /usr/script/15sec.sh & sleep 2 killall -9 15sec.sh 2>/dev/null sleep 2 rm -rf /tmp/15sec.sh ;; restart|reload) $0 stop sleep 1 $0 start ;; version) echo "15sec" ;; info) echo "15sec.sh" ;; *) echo "Usage: $0 start|stop|restart" exit 1 ;; esac exit 0
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users