Louie Crew's Tricks:Unix: Running Programs in Absentia

Louie Crew's Tricks:Unix: Running Programs in Absentia

Have you tried the 'at' command? It works like a time bomb connected to a dos batch file. For example, you might put into a file called test the commands which you want to execute. Then enter any one of these commands to make it execute, even after you have logged out. The results of the command will be mailed to you.

Suppose, for example, you wanted to see who was logged in at various times, and what they were doing, even while you were logged off. In your file called test, put this line:

                 w
 
            or this line:
 
                 finger

Next, at the andromeda/pegasus prompt enter this command to make 'test' executable:

                 chmod +x test
 
   Then enter one of these lines at the andromeda/pegasus prompt.
 
                 at 0815am Jan 24 test
                 at 8:15am Jan 24 test
                 at now + 1 day test
                 at 5 pm Friday test
                 at midnight test      [defaults to mean 'tonight', 
                                       unless past midnight]

You will get a report in your email telling you the outcome.

Once you have tried this trick. I'm sure I'll find much better uses for it.

Louie Crew

Send mail to: lcrew@andromeda.rutgers.edu