0

If I execute the following in the terminal it works:

screen -dmS tt-rss-daemon sudo -u www-data /usr/bin/php /usr/share/nginx/www/tt-rss/update.php --feeds --daemon

If I write the following in a Crontab (crontab -e) and restart the machine nothing happens.

@reboot screen -dmS tt-rss-daemon sudo -u www-data /usr/bin/php /usr/share/nginx/www/tt-rss/update.php --feeds --daemon

Have anyone an idea how to correct this?

Franz
  • 1

2 Answers2

0

is cron set to run when the system boots? Try setting it to run at a specific time, and see if it runs. If not, then odds are cron isnt running and you will need to add cron to start on the relevant run-level

in Redhat:

chkconfig cron on

in Gentoo:

rc-update add cron default

in Debian/Ubuntu

update-rc.d cron defaults

Failing that, most distributions have a script that is run on boot. In Redhat distributions its in

/etc/rc.d/rc.local

In Gentoo

/etc/local.d/anyfilename.start

In Debian I believe you have to create your own init script.

GeoSword
  • 1,677
0

Check your sudoers file and make sure you do not have requiretty enabled (look for a line like Defaults requiretty). requiretty prevents sudo from being used in cron and other non-interactive situations. It isn't the default in Debian. I am fairly certain cron should be emailing your user with the error message if that's the case (unless it's configured not to, or you sent the output to /dev/null).

Another option is if your user does not have permission to have a personal crontab. In that case, cron would just ignore your entry completely. If /etc/cron.allow exists your user must be listed in it. If /etc/cron.deny exists, your user must not be listed in it.

DerfK
  • 19,826