I want to set up cron job on amazon ec2 which insert the data in table every minute. I have followed many tutorials but I am not able to get this sorted out. I got this email in instance that file not exit
Subject: Cron <ec2-user@ip-11-----> /src/bin/php/var/www/html/test.php
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/ec2-user>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=ec2-user>
X-Cron-Env: <USER=ec2-user>
/bin/sh: /src/bin/php/var/www/html/test.php: No such file or directory
I have the test.php inside html folder which normally reside in /var/www/html
I am setting the cron in crontab using following line of code
* * * * * /src/bin/php/var/www/html/test.php
I don't what is the issue why cron is not working.
I don't know, perhaps do you try this ??
* * * * * /src/bin/php /var/www/html/test.php
With a space between /php and /var
/src/bin/php -> this part is in order to be able to execute php scripts/files.
/var/www/html/test.php -> this is the script/file that you want to execute.
Don't worry it also happens to me. Just check it.
Best regards.