crontab owns me :wtc:

Discussion in 'OT Technology' started by Saicho, Aug 31, 2007.

  1. Saicho

    Saicho New Member

    Joined:
    Feb 13, 2006
    Messages:
    359
    Likes Received:
    0
    Location:
    Seattle
    I'm trying to use crontab on a school web development server using AIX OS and for the life of me I can't get this to work.

    I've used crontab before and I think it's a huge pos since it doesn't load any environment variables and what not.

    I'm trying to run a php script I made (tested and works calling it manually that does some web crawling and sends me a few emails). But when I try to call it via crontab, not only does it not work, but it doesn't even create a log file so I have nfi what is going on. I don't know where the cron logs are located and I doubt I have access to them anyway.

    I'm using the full path names in the command:

    Code:
    /usr/local/bin/php /fullpathtoscript/script.php > /fullpathtoscript/cron.log
    Doesn't work, but same command works via command line. I know this has to be some stupid enviroment/path issue but the script uses full paths as well, and I'm even having problems running a php script that does a simple echo, and worst of all I have no idea how to see what's going wrong with the crontab. I have nfi what is going on here, can anyone de-noobify me?
     
  2. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    Last I checked crontab did all it's logging to the syslog, have you looked there for errors, warnings or something that will point you in the right direction?? I'm pretty sure crontab loads the env variables for what ever user it's running your job as ... unless AIX's implementation of crontab is totally different somehow ...
     
  3. Saicho

    Saicho New Member

    Joined:
    Feb 13, 2006
    Messages:
    359
    Likes Received:
    0
    Location:
    Seattle
    where can I find these syslogs?
     
  4. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    Depends on your syslogd.conf setup, check /var/log/syslog ... you'll need read access ...
     
  5. Saicho

    Saicho New Member

    Joined:
    Feb 13, 2006
    Messages:
    359
    Likes Received:
    0
    Location:
    Seattle
    *sigh* no read access:rl::rl:
     
  6. crontab

    crontab (uid = 0)

    Joined:
    Nov 14, 2000
    Messages:
    23,446
    Likes Received:
    12
    I > *

    You can source your environment within the same command in the cron job

    * * * * * . /path/of/the/.source.env;/usr/bin/command /path/of/conf/whatever > /path/of/output 2>&1

    the cron log is in /var/adm/cron/log for aix
     

Share This Page