Skip to main content

Posts

Showing posts from June, 2013

Process Scheduling with Timeout/Watch in Debian 6.x

The commands timeout and watch are great tools to have for reliable, on-the-fly process scheduling; especially in cases where cron isn't working properly and fixing it would take too long. I've included short descriptions of both commands and an example for you to play with.       The command timeout runs a process (command or script) for a period of time, when time runs out the command timeout sends the signal you specified to the process, and if the process is still running after a period of time the command timeout will send the process a KILL signal. The command timeout accepts intervals of seconds (s), minutes (m), hours (h) and days (d), for its period of time. The command timeout accepts all of the signals accepted by the command kill for its signal argument. Here's its command syntax: timeout -s <signal> -k <time with suffix> <duration> <process> <process arguments> The command watch periodically runs a process (command or script) for