Bash script not running within crontab job
Hi all,
I think I might have found my answer from another post but I still want to run this by everybody first just in case I should be checking something else also. I have a bash script written to go out and run perl script that collects data from a couple sensors then is supposed to populate a mysql database. This script runs perfectly from the command line but will not function from a crontab job. Below is a copy of the script and a copy of the crontab. From the other post it looks like I need to change the #! /bin/bash to #! /bin/sh is this correct? I'm logged in as root by the way and its being run on FC5. Bash script: #! /bin/bash # script to run the digitemp_mysql.pl program cd /root/digitemp-3.5.0/perl/ .//digitemp_mysql.pl Cron job: 1 * * * * /root/digitemp-3.5.0/perl/digitemp_my_sql Thank you for your assistance in advance. Mark |
Quote:
eg; Instead of... Code:
cd /root/digitemp-3.5.0/perl/ Code:
/bin/cd /root/digitemp-3.5.0/perl/ |
Quote:
Any thoughts on this is also appriciated. As you probably guess I'm a real newbie to all this linux and script stuff. Mark |
Figured out why I wasn't getting the crontab job to run every minute like I wanted. I thought 1 * * * * would run every minute not one minute past every hour.
After discovering I had 9 hours of data recorded today when I got home I noticed they were all stored at XX:01. I looked at the cron instructions a litte more and figured out what I really wanted was 0-59 0-23 * * * (command). Thanks to everybody who looked at the post!! Being new to linux is so much fun LOL Mark |
All times are GMT -5. The time now is 08:12 PM. |