0

In my raspberry I'm using the following crontab to start two services at startup. The first one works fine but the second one doesn't (even though it works fine when I launch it manually). Any suggestions what could be causing this are highly appreciated.

# m h  dom mon dow   command
0 * * * * python pythonprojects/temperature_sensor/read_temperature.py
@reboot             sudo /usr/local/bin/pigpiod
@reboot             sudo /usr/bin/autossh -M 20005 -N -T -R22222:localhost:22 -i ssh-ec2/ec-key.pem ec2-user@xx.xx.xx.xxx
Nickpick
  • 145
  • 8

1 Answers1

1

Remove the sudo and have this

  • directly in root's crontab or
  • in /etc/crontab having the user set to root

    @reboot   root   command parameters
    

Cron is not able to interactively ask for sudoer's password.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122