LinuxQuestions.org
Visit Jeremy's Blog.
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 11-19-2007, 05:38 AM   #1
monk5854
LQ Newbie
 
Registered: Nov 2007
Posts: 7

Rep: Reputation: 0
Strange Crontab problem(!?)


Hi all, I use a Red Hat 3.4.6-8 and this is what I obtain after crontab -l as root :

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
# minuts (0-59),
# | hores (0-23),
# | | dia del mes (1-31),
# | | | mes de l'any (1-12),
# | | | | dia de la setmana (0-7 with 0=Sunday).
# | | | | | comanaments
# | | | | | |

01 * * * * root run-parts /etc/cron.hourly
15 10 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
50 10 * * 1-5 root /usr/bin/backup-af5.sh <----
25 4 * * 1-5 root /usr/bin/backup-barma.sh <----
00 18 * * * root /root/comprobar-espacio-ocupado.sh

Now, I edit (crontab -e) the minute when /usr/bin/backup-af5.sh will run. I set it at 10:30

both scripts, (with arrows) exist and have all permissions, the path, as you can see, is included, and here is where the strange behaviour takes place:

[root@asterisk]# tail -f /var/log/cron

Nov 19 10:28:44 asterisk crontab[6996]: (root) REPLACE (root)
Nov 19 10:28:44 asterisk crontab[6996]: (root) END EDIT (root)
Nov 19 10:29:01 asterisk crond[3300]: (root) RELOAD (cron/root)
Nov 19 10:30:01 asterisk crond[7002]: (root) CMD (root /usr/bin/backup-af5.sh)

but
[root@asterisk]# ps -ef | grep af5

shows nothing!, so, how can cron be conscious that it has to run /usr/bin/backup-af5.sh and not to run it??.
 
Old 11-19-2007, 06:38 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
ps shows active processes. If the script tried to run, but failed, it would not be active and would not show. Try (as root) 'cat /var/log/messages | grep afs' to see if there are any errors reported.
 
Old 11-19-2007, 08:24 AM   #3
cconstantine
Member
 
Registered: Dec 2005
Distribution: RedHat, Ubuntu
Posts: 101

Rep: Reputation: 15
make script produce output?

adjust your .sh script so it produces output. That should go via email to root when it completes. Just add "-x" to the #! line at the top.
-c
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
crontab problem almon Linux - Newbie 1 10-11-2007 02:27 PM
crontab runs and stops in middle of process. Strange! Micro420 Linux - General 2 03-28-2007 02:46 AM
crontab problem pdrobe Red Hat 1 02-05-2005 03:19 PM
strange, strange alsa problem: sound is grainy/pixellated? fenderman11111 Linux - Software 1 11-01-2004 05:16 PM
problem with crontab juanb Linux - Newbie 2 12-16-2003 04:54 AM

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

All times are GMT -5. The time now is 06:46 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