dbarasuk - 2:53 pm on Aug 8, 2012 (gmt 0)
which php yields /usr/bin/php.
Thus, my php cron file begins so:
Notice the php script tag <?php at line 1 is omitted. Is this an error?
Besides, while creating the cron tab, the procedure i followed was this:
I logged in root, then typed 'crontab -e' where i typed the following as the crontab:
30 15 * * * /usr/bin/php /path/to/php/file > /tmp/export-to-oracle.log to be executed at the given time. I also did 'chmod' +x /path/to/php/file so that the file can be executed by the system.
Also notice that the ending php tag '?>' is omitted. So basically my whole php file looks like a text file.
To see whether the cron job was executed at all I open /var/log/cron and indeed i found something like:
Aug 8 16:42:01 barasukana-lp CROND: (root) CMD (/usr/bin/php /var/www/html/rcms/includes/exportMysqlToOracle.php > /tmp/export-to-oracle.log)
which show that the script was executed really. But, but, ...
when I open /tmp/export-to-oracle.log I found that the whole php batch file was fully written there.
In fact the php cron was to select data from mysql and just send the result in another oracle table. When I did 'SELECT count(*) FROM ora_table' i keep getting same count result over and over again. But running that same php file at command line sends the data to the appointed oracle table.
WHERE AM I WRONG?,
please help. If someone has come accross this, i'd appreciate if s/he show me the tutorial s/he used to get around this problem