LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cron job/gdesklets help (https://www.linuxquestions.org/questions/linux-software-2/cron-job-gdesklets-help-408071/)

spin2cool 01-26-2006 12:23 AM

cron job/gdesklets help
 
Since gdesklets seems to have a pretty bad memory leak, I'd like to have cron kill it and restart it once in a while. I've having trouble with getting cron to launch gdesklets, though.

Say I wanted to do it at 11 after every hour. I stick this in my crontab file to kill gdesklets:

Code:

11 * * * * myusername kill $(pgrep -f gdesklets)
and it works great!

The next line is supposed to restart gdesklets, though, and doesn't seem to work:
Code:

11 * * * * myusername gdesklets
I've also tried substituting "gdesklets restart" and "gdesklets shell" and neither works. If I go to a terminal and type any of these commands in, gdesklets comes up just fine, though.

Any ideas why this isn't working, or how to fix it??

dugas 01-26-2006 09:09 PM

Have you tried putting the full path to gdesklets?

spin2cool 01-26-2006 09:55 PM

Nope - the path isn't the problem.

It doesn't seem to work with any program that requires a display window (gdesklets, gedit, firefox, etc).

Someone on another forum suggested that it might be a problem with proper access (xauth) or setting a display, but I'm having trouble finding information on either of those in the context of this problem.

Here are the contents of my /etc/crontab file, if it helps:

Code:

SHELL=/bin/bash
PATH=/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/games

# m h dom mon dow user        command
17 * * * * root    run-parts --report /etc/cron.hourly
25 6 * * * root        test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6 * * 7 root        test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6 1 * * root        test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
50 * * * * myusername gdesklets
#



All times are GMT -5. The time now is 05:06 PM.