Results 1 to 3 of 3
Hi,
I wrote a bash script to check when my password will expire. 5 days before the expiration, I create a file (/tmp/warningPasswd) that contains something like :
You password ...
- 11-29-2009 #1Just Joined!
- Join Date
- Oct 2006
- Posts
- 29
How to open a pop-up window using cron.
Hi,
I wrote a bash script to check when my password will expire. 5 days before the expiration, I create a file (/tmp/warningPasswd) that contains something like :
You password will expire in 5 days.
Everything is managed with the script and cron and works fine.
But I would like to open a window (a text editor window or a notification window with notify-send for example) which would make it easier for the user to know that his password will expire soon rather than letting him check if the /tmp/warningPasswd file exists or not.
I did not succeed to make cron open any window. How can I do ?
I must precise that I can't send any mail as the mail function is de-activated at my work for security reasons.
Regards.
Xuo.
- 11-29-2009 #2
As you already have mentioned, notify-send is a way to achieve this.
For example
But this only sends the message to the user who has executed the command.Code:notify-send 'CRONJOB speaking' 'Hello, this is the cronjob'
If the cronjob is executed by root user, you would need to use sudo.Debian GNU/Linux -- You know you want it.
- 11-30-2009 #3Just Joined!
- Join Date
- Oct 2006
- Posts
- 29
Hi,
Thank you for your answer.
I have the same problem with notify-send, which is an X11 problem (this is what the mail I received from cron was suggesting).
I modified my crontab this way :
DISPLAY :0.0
00 19 * * * /fullPath/myScript.csh
Doing this, myScript.csh can do something like "$EDITOR /tmp/warningPasswd".
I don't know if setting this variable in the script itself would do the same.
Xuo.


Reply With Quote