I have this code bellow to run in command line but is not working. I tried in command line to run without the cron tab and it works. Anyone knows how to fix it ? Thanks in advance.
*/5 * * * * /usr/bin/php /var/www/html/ulchemdb/File_upload/uploads/crontab.php > /dev/null 2>&1
答案 0 :(得分:1)
If yes => remove output redirecting to dev/null for a time (remove part " > /dev/null 2>&1"), use redirecting to log file, for instance:
*/5 * * * * PATH-TO-PHP/php /var/www/html/ulchemdb/File_upload/uploads/crontab.php > /var/log/php.log 2>&1
Investigate a log after some time. Is there something? If no => make sure you script have some output.
答案 1 :(得分:1)
Crontab line is ok:
*/5 * * * * php /var/www/html/ulchemdb/File_upload/uploads/crontab.php
I think the problem with script.
try to run it manualy:
php /var/www/html/ulchemdb/File_upload/uploads/crontab.php
or if You don't have opportunity to get to console do following:
add line to then end of crontab.php:
echo "\nCOMPLETED SUCCESSFULY\n"
add this crontab line:
*/5 * * * * php /var/www/html/ulchemdb/File_upload/uploads/crontab.php >> /var/www/html/ulchemdb/File_upload/uploads/crontab.log
Also You can share with us Your code, we'll try to help You somehow.
答案 2 :(得分:0)
try
*/5 * * * * php /var/www/html/ulchemdb/File_upload/uploads/crontab.php > /dev/null 2>&1