1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Linux FreeBSD Cron Issue

Discussion in 'Software' started by ColD_FusSioN, 14 Oct 2005.

  1. ColD_FusSioN

    ColD_FusSioN What's a Dremel?

    Joined:
    26 May 2004
    Posts:
    93
    Likes Received:
    0
    i have 2 scripts one in PHP and the other in shell, that i need to execute daily to backup some information from a MySQL database.
    In the crontab i have:
    10 0 * * * root /home/eorozco/moducaaarem/limpia-caaarem-modul
    5 0 * * * root /home/eorozco/scripts/revisa-conta.sh

    the first script works perfectly, but the second does not, but if i run it manually it works....

    the code of the second script is:

    diaant=`cat dia-ant.dat|awk -F '|' '{print $1}'` export diaant;
    mesant=`cat dia-ant.dat|awk -F '|' '{print $2}'` export mesant;
    anioant=`cat dia-ant.dat|awk -F '|' '{print $3}'` export anioant;
    php -f /home/eorozco/scripts/getfilesloaded.php
    if [ -e `echo "$diaant$mesant$anioant-val.log"` ]
    then
    tar -czf `echo "$diaant$mesant$anioant-val.tar.gz"` `echo "$diaant$mesant$anioant-val.log"`
    mv `echo "$diaant$mesant$anioant-val.tar.gz"` /usr/users/op/clientes/resp/bitacoras
    rm `echo "$diaant$mesant$anioant-val.log"`
    fi
    echo "`date +%d`|`date +%m`|`date +%Y`|" > dia-ant.dat


    do you have any idea why is this issue???? :wallbash:
     
  2. kiljoi

    kiljoi I *am* a computer king.

    Joined:
    13 Oct 2003
    Posts:
    2,301
    Likes Received:
    0
    When you run the script manually, do you have to cd to the directory it's in first? I have a few scripts on my nix box that won't run unless you are currently in the directory where the script is.
     
  3. ColD_FusSioN

    ColD_FusSioN What's a Dremel?

    Joined:
    26 May 2004
    Posts:
    93
    Likes Received:
    0
    I am currently putting the full path in every file that i access with the scripts, since probably that may be the cause because when i try to run the scripts from another directory i get a warning message from a fopen in a procedures script in php.

    Thanks in advance, i will post if that work...
     
    Last edited: 17 Oct 2005
  4. ColD_FusSioN

    ColD_FusSioN What's a Dremel?

    Joined:
    26 May 2004
    Posts:
    93
    Likes Received:
    0
    The full path thing doesn't work... i think it was going to solve the problem... the funny thing is that the other script the cron executes works well...
     
Tags:

Share This Page