LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-12-2012, 07:38 AM   #1
Eisenhorn
LQ Newbie
 
Registered: May 2012
Posts: 2

Rep: Reputation: Disabled
Yet another problem with CRON


Hi,
I know there a lot of threads discussing cron, but still these didn't help to solve my problem.
I have a script named ciscal which is located in /etc/cron.hourly.
Unfortunately this script wont execute. Thats what the command
Code:
 tail -200  /var/log/syslog | grep CRON
says

Code:
May 12 13:39:01 localhost /USR/SBIN/CRON[16000]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete)
May 12 13:39:01 localhost /USR/SBIN/CRON[15998]: (root) END (  [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete)
May 12 14:01:01 localhost /USR/SBIN/CRON[16507]: (root) CMD (run-parts /etc/cron.hourly)
May 12 14:01:06 localhost /USR/SBIN/CRON[16506]: (root) END (run-parts /etc/cron.hourly)
The name should be ok, as I have read that .sh can cause troubles. I can see that cron executes at the deisred time but the script is not executed, altough
Code:
run-parts --test /etc/cron.hourly
/etc/cron.hourly/ciscal
says it would do so.

Persmissions look like this
Code:
-rwxr-xr-x   1 root root    66 May 12 10:56 ciscal
so this should do fine.
The script itself looks like this
Code:
#!/bin/bash
echo "Test" > output
/usr/local/sbin/rubyscripts/cal
If I start it manually it works just fine. I really dont have any clue anymore.
Ah the cronttab looks like this
Code:
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

#SHELL=/bin/sh
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/

# m h dom mon dow user  command
#17 *   * * *   root    cd / && run-parts --report /etc/cron.hourly
01  *   * * *   root    run-parts /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 )
#
BR
 
Old 05-13-2012, 12:39 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,802

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
I would rather write (in ciscal) echo "Test" > /full/path/to/output, and check that file. Also there can be a problem with the file /usr/local/sbin/rubyscripts/cal.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Cron directories: /var/spool/cron/cron.GfqqGO Woodsman Slackware 4 05-11-2011 02:37 PM
cron.hourly cron.weekly cron.monthly and 0anacron. Are they necessary? glore2002 Debian 2 09-30-2009 08:57 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration