i have move_files.sh and installed it in crontab.
Actually job is working because it's printing those echo. And creating log file. But it's not calling that PHP script. Interesting thing is if i run it by manually it's calling php script and working 100%. But why it's not calling after i installed it on crontab. should i put "php" before calling php script. I am thinking that cronjob would work same as manually running script. Please give me idea.
My code is below.
#!/usr/local/bin/bash
DIR=/data/aa/bb
LOG=~account/HOME/log/dd
DATE=`date +%Y%m%d`
LOG_FILE=$LOG/move_files.$DATE.log
PROG=~account/HOME/bin/move_files.php
for type in "1" "2" "3"
do
echo "Check files in $DIR/dat/$type" >> $LOG_FILE
$PROG $DIR/dat/$type $DIR/backup/$type >> $LOG_FILE
echo "Compress files in $type" >> $LOG_FILE
find $DIR/backup -name "*.DAT" -type f -exec gzip -f {} \; >> $LOG_FILE
done
~/account. check selinux logs if it isenforcing. Always use full path for files when running from cron jobsealert -aon the audit log eg:sealert -a /var/log/audit/audit.log. You may need root permission for this.