I'm running Debian testing and can't get a simple cron to run a symlinked PHP script.
I've a php script in a subdirectory in my home folder /home/foobar/dir/script.php
(which starts with the following shebang #!/usr/bin/env php
).
I've created a symlink which points to it:
sudo ln -s ~/dir/script.php /usr/local/bin/whatever
ls -la /usr/local/bin
lrwxrwxrwx 1 root staff 24 Feb 27 17:46 whatever -> /home/foobar/dir/script.php*
And added the following rule to my crontab (execute whatever
every minute):
crontab -e
* * * * * whatever
But it doesn't work, I get the following error:
cat /var/mail/foobar
...
/bin/sh: 1: whatever: not found
While pointing to the script without using the symlink works:
crontab -e
* * * * * /home/foobar/dir/script.php
Any idea?