View previous topic :: View next topic |
Author |
Message |
Heratiki n00b
Joined: 16 Sep 2006 Posts: 24
|
Posted: Mon Sep 25, 2006 7:34 am Post subject: Warning users about cron jobs... |
|
|
Ok well here it goes... I just thought I would ask if there is a way to perhaps warn the users of the system about cron jobs up and coming or possibly right before they are to commence... That way if something like updatedb (drive & cpu hog) or maybe prelink was going on the user would know it and wouldn't think "Oh Crap What Did I Do"... Believe it or not these are the things I do... LOL... I am maybe watching a flick or whatever on my Inspiron 1100 and then everything starts to crawl to a stop and I go oh snap what did I do... Then only to realize ok it's probably cron... But I don't want to think oh it's probably cron when it could be something like a misplaced cp and all of a sudden I'm duping the drive to /mnt/tmp or something... Ok my rant is over... Anyone know how to do this... Maybe watch the cron or send out some root based warning... Not allow them to stop or start it but simply just know that it's coming...
Heratiki |
|
Back to top |
|
|
zsoltika l33t
Joined: 13 Nov 2003 Posts: 634 Location: Budapest, Hungary
|
Posted: Mon Sep 25, 2006 12:51 pm Post subject: |
|
|
Edit the crontab command part to something like: Code: | nail -s "Cron will run: <what>" your@mail.adress && <desired command> |
(If you have 'nail' installed. Or choose anoteher command line mail client.) Also check /etc/cron* files.
HTH _________________ Do not believe that Guru thing under my nickname. |
|
Back to top |
|
|
Heratiki n00b
Joined: 16 Sep 2006 Posts: 24
|
Posted: Tue Sep 26, 2006 3:09 am Post subject: |
|
|
What I was thinking of is if there was a way to message the user directly either through a terminal window or possibly via a message through X... Just looking for a way to do this so that I can create a bash script that will do it automatically... IE you would just type cronmsg and the cron job you want to have message and then the users... I'm not really that good at bash and am still learning much of Gentoo and linux... So I'm just trying to get some pointers before I undertake something so big...
Heratiki |
|
Back to top |
|
|
beandog Bodhisattva
Joined: 04 May 2003 Posts: 2072 Location: /usa/utah
|
Posted: Tue Sep 26, 2006 3:13 am Post subject: |
|
|
_________________ If it ain't broke, tweak it. dvds | blurays | blog | wiki |
|
Back to top |
|
|
zsoltika l33t
Joined: 13 Nov 2003 Posts: 634 Location: Budapest, Hungary
|
Posted: Tue Sep 26, 2006 6:42 am Post subject: |
|
|
But if you plan to use 'xmessage' (or something like 'zenity' or 'kdialog' or 'xdialog' - here is a nice tutorial) you should take care of the $DISPLAY variable in your script (or crontab) - usually it's unset while cron running.
HTH _________________ Do not believe that Guru thing under my nickname.
Last edited by zsoltika on Thu Sep 28, 2006 2:14 pm; edited 1 time in total |
|
Back to top |
|
|
beandog Bodhisattva
Joined: 04 May 2003 Posts: 2072 Location: /usa/utah
|
Posted: Tue Sep 26, 2006 3:39 pm Post subject: |
|
|
zsoltika wrote: | But if you plan to use 'xmessage' (or something like 'zenity' or 'kdialog' or 'xdialog' - here is a nice tutorial) |
Holy crap that's the coolest thing Ive seen in a while. Wow. *gets ideas*
Thanks man _________________ If it ain't broke, tweak it. dvds | blurays | blog | wiki |
|
Back to top |
|
|
zsoltika l33t
Joined: 13 Nov 2003 Posts: 634 Location: Budapest, Hungary
|
Posted: Tue Sep 26, 2006 5:48 pm Post subject: |
|
|
Your welcome. I use kdialog extensively, for monitoring directory contents (automatically disappearing information bubble), changed database contents, etc.
These are nice tools.
Cheers, _________________ Do not believe that Guru thing under my nickname. |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Tue Oct 17, 2006 10:45 am Post subject: |
|
|
or maybe you could nice the cron job enough so it doesn't impact the users |
|
Back to top |
|
|
pathfinder l33t
Joined: 19 Jan 2006 Posts: 731 Location: Barcelona, Spain
|
Posted: Tue Oct 17, 2006 10:52 am Post subject: |
|
|
i have no idea in order to help you solving the problem,... but i personally use TOP and WHO when i feel the computer is slow.
that might help a wrong CP process... i guess you knew that... _________________ Cuando un tonto coge un camino, el camino se acaba, pero el tonto sigue |
|
Back to top |
|
|
thuk n00b
Joined: 26 Oct 2005 Posts: 31 Location: Canberra, Australia
|
Posted: Tue Oct 17, 2006 10:52 am Post subject: |
|
|
Hi There,
It's probably not good to involve X/graphical programs with cron; it's probably much easier to use the command 'wall', which is designed to do exactly what you are looking for - sending a message to everyone's terminals. See the man page for usage. For sending messages to specific users, you can use 'write'.
Cheers,
thuk |
|
Back to top |
|
|
Bones McCracker Veteran
Joined: 14 Mar 2006 Posts: 1611 Location: U.S.A.
|
Posted: Tue Oct 17, 2006 11:10 am Post subject: |
|
|
or maybe you could at the cron job so it doesn't impact users |
|
Back to top |
|
|
|