Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 6114  / 1 Year ago, tue, march 21, 2023, 5:35:33

I need to start a Python script every day at midnight, and after some searching on the internet, I found out, that I can use cron for that. What I am curious about is, that if I schedule a cron task for midnight, will it wake up my computer to do the job? Or do I have to wake up the computer using something else? I am using Ubuntu 16.04.


More From » scripts

 Answers
6

Short answer:


No.


You can however use rtcwake. With rtcwake, you can wake up the computer, set it up to run commands and scripts afterwards etc.


Options include both waking up at an absolute time, as well as waking up at a specific time span from now:


-s seconds | --seconds seconds
Sets the wakeup time to seconds in future from now.
-t time_t | --time time_t
Sets the wakeup time to the absolute time time_t. time_t is the time in seconds since 1970-01-01, 00:00 UTC. Use the

An example of how rtcwake can be used is in this answer.

See also, as always, man rtcwake


[#13848] Tuesday, March 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rtbrbab

Total Points: 461
Total Questions: 126
Total Answers: 117

Location: Saudi Arabia
Member since Fri, Jul 1, 2022
2 Years ago
;