[ Prev ] [ Table of Contents ] [ Front Page ] [ FAQ ] [ Next ]

(?) The Answer Guy (!)

By James T. Dennis, tag@lists.linuxgazette.net
LinuxCare, http://www.linuxcare.com/

(?) Simple Shell and Cron Question

From Amir Shakib Manesh on Thu, 08 Jun 2000

Dear ANswer Duy, I want to write a shell script, in which every 15 minutes it run a simple command, let say 'top -b'. Would you help me?

(!) Well one way would be to make a cron entry like:
*/15 * * * *  top -b
... which you'd do by just issuing the command: 'crontab -e' from your shell prompt. That should put you in an editor from which you can type this command.

(?) Also is there any way to prevent from auto-log out in unix?


Amir Shakib-Manesh

(!) UNIX and Linux don't have an "auto-log out" mechanism by default. So if you are getting logged out after some period of inactivity then the details of how you'd bypass that depend on the mechanism that's being used by your sysadmins. Ask them.
(Other than that one of the possibilities is that they are setting a special variable in your shell, like TMOUT in bash. Read the bash man pages and search on TMOUT to see on that works. There are similar features in some other shells. That's a pretty common and relatively harmless way to encourage users not to leave their prompts unattended. Other methods involve some daemon like "idled" which runs as 'root' and watches for inactivity, pouncing on line hogs with 'kill' signals).

Copyright © 2000, James T. Dennis
Published in The Linux Gazette Issue 55 July 2000
HTML transformation by Heather Stern of Tuxtops, Inc., http://www.tuxtops.com/

[ Answer Guy Current Index ] greetings   1   2   3   4   5   6   7   8   9   10   11   12   13  
14   15   16   17   18   19   20   21   22  
[ Index of Past Answers ]

[ Prev ] [ Table of Contents ] [ Front Page ] [ FAQ ] [ Next ]