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