Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 8607  / 3 Years ago, fri, june 4, 2021, 4:40:02

I intend to put my computer to sleep every night and make it wake up again next morning. I found that rtcwake would serve my purpose. However putting it in the crontab does nothing. Following is my crontab entry for "root" user



0 1 * * * rtcwake -m disk -s 25200


I added it using 'sudo crontab -e'. The syslog shows that it executed the command, but the computer does not sleep. If I run the command on terminal directly, the computer is put to sleep immediately as expected. So I don't think there is any problem with ACPI.



Does anyone have a clue? I am on Ubuntu 14.04


More From » suspend

 Answers
4

Okay, I think I've found the solution. Adding a sudo before rtcwake solves the problem.



I now however have following question: Why does a root's crontab need sudo to run a command. Isn't it already running under root?


[#24076] Saturday, June 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
piscen

Total Points: 134
Total Questions: 117
Total Answers: 133

Location: Indonesia
Member since Wed, Jul 7, 2021
3 Years ago
;