Rtcwake for sleep in the night?

Brief description of the problem

I am trying to use the ‘rtcwake’ command to have my rockstor server sleep in the night when I don’t need it. If I run the command in the system shell it works, but putting it in cron (sudo crontab -e) i get an error that the command doesn’t exist.

Does anyone have suggestions for using rtcwake correctly here or another tool that would do the trick for me?

@straighttalk86 Hello again.

It’s likely that your crontab entry does not have the full path of the command, hence the:

This is a common failing in constructing cronjobs. Make sure to put the full path to all commands in your cron entry. A “which <command-here>” should tell you the full path of the command.

Also re:

Did you know we have two scheduled task types for such things:

  • System Suspend
  • System Shutdown

scheduled-suspend-shutdown

Hope that helps.

3 Likes

Thanks so much for the quick response!

I was not aware that there was a scheduled task type for this already. I will remove the cron job and utitlize the Task Scheduler instead.

I didn’t test it, but i’m sure you were right about the full path being needed. The path ended up being ‘/usr/sbin/rtcwake’

2 Likes