I understand that SO is a question, but no matter how many tutorials I looked at, I can not get my crontab to work, and I create a website that will rely on crontab to reset a specific parameter to my database every night .
Here is my crontab file:
# Edit this file to introduce tasks to be run by cron.
If I try to cd before /usr/bin/php get
-bash: cd: /usr/bin/php: Not a directory
So, I cd just /usr/bin/ , and here is what I found:
-rwxr-xr-x 1 root root 27216 Feb 10 15:08 pgrep* lrwxrwxrwx 1 root root 21 Jun 13 09:36 php -> /etc/alternatives/php* -rwxr-xr-x 1 root root 9049256 Jul 2 11:57 php5*
If I cd before /etc/alternatives , I find:
lrwxrwxrwx 1 root root 13 Jun 13 09:36 php -> /usr/bin/php5*
Back to the bin file, php5 has the * character and green.
-rwxr-xr-x 1 root root 9049256 Jul 2 11:57 php5*
My PHP script. Very simple. It checks the cookie, and if it exists, it increments it by one. Then I check the results on another page. Manually this works. With crontab it is not possible to make it work.
if (!empty($_COOKIE['cronTest'])) { $int = $_COOKIE['cronTest']; $int++; setcookie("cronTest", $int, time()+3600); }
source share