Run commands periodically without cron is possible?

In Linux - can run periodical commands without cron ??!??.......

Yeah, Running commands periodically without cron is possible when we go with "while".

As a command:

# while true; do <your command here> ; sleep 100; done &

Example: # while true; do echo "Hello World" ; sleep 100; done &

do not forget the last "&" as it will put your loop in the background.

Same way to call a script,

crate file name: while_check.sh

# cat while_check.sh
#!/bin/bash
while true; do /bin/sh script.sh ; sleep 100; done &

# cat script.sh
echo "Hello World"

# ./while_check.sh

Is it useful??

Comments

Popular posts from this blog

Resolved: DOCKER: Error response from daemon: Could not attach to network / rpc error: code = 7 desc = network not manually attachable.

yum failed 6 times. Cannot continue!

unexpectedly shrunk window (repaired) in dmesg log - TCP Peer