Hi,
I'm not actually new to linux but posting in here as I'm pretty sure the fix to this will be simple plus i'm really out of practice! ;P
Searched all over forums & google and just can't seem to fix my problem with the information i've collected :/
Basically I have a script, kept in /usr/sbin/ called force-standby, goes a little something like this;
I have a "monitoring screen" so all staff can view events popping up in zabbix - on this box I'm running caffeine so the monitor doesn't sleep during the day, and use this script to make the monitor sleep when we leave the office.
The script runs OK if you run it from the box, under both root and the one other user account, as you can see ive set up a basic log to tell me each time the script runs.
However cron just wont run it, I've stuck it in /etc/crontab - perhaps this is the wrong file to be editing for kubuntu i'm not sure, this is how it reads;
And this is the response I get from cron in /var/log/syslog;
Cron just refuses to run the script, i've tried it in user crontab, and also tried changing roots crontab to a different user and removing any user at all, I've also tried removing the path but still nothing :/
Can anyone help?
Thanks!
I'm not actually new to linux but posting in here as I'm pretty sure the fix to this will be simple plus i'm really out of practice! ;P
Searched all over forums & google and just can't seem to fix my problem with the information i've collected :/
Basically I have a script, kept in /usr/sbin/ called force-standby, goes a little something like this;
Code:
#!/bin/bash xset dpms force standby echo "logging!" >> /tmp/fslogs.log
The script runs OK if you run it from the box, under both root and the one other user account, as you can see ive set up a basic log to tell me each time the script runs.
However cron just wont run it, I've stuck it in /etc/crontab - perhaps this is the wrong file to be editing for kubuntu i'm not sure, this is how it reads;
Code:
SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) 32 10 * * * root /usr/sbin/force-standby #
Code:
Apr 19 07:53:33 monitor rsyslogd: [origin software="rsyslogd" swVersion="4.2.0" x-pid="805" x-info="[url]http://www.rsyslog.com"][/url] rsyslogd was HUPed, type '$ Apr 19 07:53:33 monitor anacron[18305]: Job `cron.daily' terminated Apr 19 07:53:33 monitor anacron[18305]: Normal exit (1 job run) Apr 19 08:17:01 monitor CRON[19047]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Apr 19 09:17:01 monitor CRON[19840]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Apr 19 10:17:01 monitor CRON[20693]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Apr 19 10:29:00 monitor init: cron main process (7280) killed by TERM signal Apr 19 10:29:00 monitor cron[20962]: (CRON) INFO (pidfile fd = 3) Apr 19 10:29:00 monitor cron[20963]: (CRON) STARTUP (fork ok) Apr 19 10:29:00 monitor cron[20963]: (CRON) INFO (Skipping @reboot jobs -- not system startup) Apr 19 10:32:01 monitor CRON[21009]: (root) CMD (^I/usr/sbin/force-standby) Apr 19 11:17:01 monitor CRON[21699]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Can anyone help?
Thanks!
Comment