LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Strange Crontab problem(!?) (https://www.linuxquestions.org/questions/linux-general-1/strange-crontab-problem-600792/)

monk5854 11-19-2007 05:38 AM

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??.

bigrigdriver 11-19-2007 06:38 AM

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.

cconstantine 11-19-2007 08:24 AM

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


All times are GMT -5. The time now is 04:07 PM.