Quantcast
Viewing latest article 7
Browse Latest Browse All 48

Answer by Henrik N for Why crontab scripts are not working?

Cron jobs won't run if your user's password has expired.

One indication of this is if your cron log (typically /var/log/syslog on Ubuntu, I believe) contains messages like "Authentication token is no longer valid; new one required".

You can check for this problem by running sudo chage -l the_username.

Here's an example of an expired password:

$ sudo chage -l rootLast password change                    : password must be changedPassword expires                    : password must be changedPassword inactive                   : password must be changedAccount expires                     : neverMinimum number of days between password change      : 0Maximum number of days between password change      : 14600Number of days of warning before password expires   : 14

The fix is to change the password. For example:

sudo -u root passwd

Then follow the instructions, specifying a new password as prompted.

Thanks to https://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it#comment966708_544905 for pointing me in the right direction here. In my case, just as for that commenter, it was the root user of a DigitalOcean box.


Viewing latest article 7
Browse Latest Browse All 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>