Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Warning users about cron jobs...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Heratiki
n00b
n00b


Joined: 16 Sep 2006
Posts: 24

PostPosted: Mon Sep 25, 2006 7:34 am    Post subject: Warning users about cron jobs... Reply with quote

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
View user's profile Send private message
zsoltika
l33t
l33t


Joined: 13 Nov 2003
Posts: 634
Location: Budapest, Hungary

PostPosted: Mon Sep 25, 2006 12:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Heratiki
n00b
n00b


Joined: 16 Sep 2006
Posts: 24

PostPosted: Tue Sep 26, 2006 3:09 am    Post subject: Reply with quote

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
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Tue Sep 26, 2006 3:13 am    Post subject: Reply with quote

Code:
$ xmessage foo

_________________
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
zsoltika
l33t
l33t


Joined: 13 Nov 2003
Posts: 634
Location: Budapest, Hungary

PostPosted: Tue Sep 26, 2006 6:42 am    Post subject: Reply with quote

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
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Tue Sep 26, 2006 3:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
zsoltika
l33t
l33t


Joined: 13 Nov 2003
Posts: 634
Location: Budapest, Hungary

PostPosted: Tue Sep 26, 2006 5:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Tue Oct 17, 2006 10:45 am    Post subject: Reply with quote

or maybe you could nice the cron job enough so it doesn't impact the users
Back to top
View user's profile Send private message
pathfinder
l33t
l33t


Joined: 19 Jan 2006
Posts: 731
Location: Barcelona, Spain

PostPosted: Tue Oct 17, 2006 10:52 am    Post subject: Reply with quote

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
View user's profile Send private message
thuk
n00b
n00b


Joined: 26 Oct 2005
Posts: 31
Location: Canberra, Australia

PostPosted: Tue Oct 17, 2006 10:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Tue Oct 17, 2006 11:10 am    Post subject: Reply with quote

or maybe you could at the cron job so it doesn't impact users
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum