Check if file crontab runs
Solution 1:
You cannot simply sudo in cron, since it will ask for the sudo password. You'd have to setup passwordless sudo for that command.
Since the php file is in the /root dir (take note it's a security concern), you could install the crontab as root (sudo crontab -e
) and put the line in there (without sudo).
If your script doesn't require root privileges, you could run without sudo, but you'd have to move the files to a readable location, since /root is owned and restricted to the root user.