Friday, August 22, 2008

Opening a terminal window using cron

Fast experiment to use cron to open a terminal window and execute a command. Success!

The crontab item is:

* * * * * DISPLAY=:0.0 /usr/bin/xfce4-terminal -x top
     # * * * * *               - the crontab time codes. Substitute your own.
     # DISPLAY=:0.0            - sends the subsequent commands to the screen
     # /usr/bin/xfce4-terminal - the application (opens a terminal window)
     # -x top                  - execute the top command in the application
Once a minute, a new terminal window spawns running 'top', just as intended.

1 comment: