Wednesday, May 19, 2010

execute a program periodically

To execute a program periodically, you can use 'watch' command

watch runs command periodically, displaying its output. This allows you to watch the command output change over time.
By default, the command is run every 2 seconds. Use -n or --interval to specify a different interval.

e.g.;

watch df -h
checks free disk space in every 2 seconds.

watch -n 5 df -h
checks free disk space in every 5 seconds.

   

No comments:

Post a Comment

There was an error in this gadget