LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-01-2014, 05:11 PM   #1
nix.noob
Member
 
Registered: Aug 2013
Posts: 31

Rep: Reputation: Disabled
Cron while suspended?


I'm running Mint with a setting that will 'suspend' after being idle for 30 minutes
If I create a cron job to run in the middle of the night (i.e. while its suspended) would it run?

And if not, what's the usual way to run cron jobs without leaving the machine fully powered up all the time?
 
Old 03-01-2014, 05:14 PM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by nix.noob View Post
I'm running Mint with a setting that will 'suspend' after being idle for 30 minutes
If I create a cron job to run in the middle of the night (i.e. while its suspended) would it run?
No.
Quote:
And if not, what's the usual way to run cron jobs without leaving the machine fully powered up all the time?
Turn the machine on prior to the cronjob time.
 
Old 03-01-2014, 11:32 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
In short, as implied above, you must allow the system to run in order for anything like eg cron to run.
 
Old 03-02-2014, 05:59 AM   #4
nix.noob
Member
 
Registered: Aug 2013
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
>>>> No

> And if not, what's the usual way to run cron jobs without leaving the machine fully powered up all the time?

>>>> Turn the machine on prior to the cronjob time.
Thanks very much for this.

For anyone else that looks at this question, I've found out about two possible approaches.
1. rtcwake : this can wake the machine up from its standby state. Having done so, a cron job can run as normal
2. anacron (or fcron) : Alternative cron that takes into account the fact that the machine might not be on all the time. Any jobs that have not run at the requested scheduled time are run when the machine is next turned on (after some configurable delay)

I'm going to explore using approach #1 and set an rtcwake time with a cron job and with a script in /etc/init.d
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Cron directories: /var/spool/cron/cron.GfqqGO Woodsman Slackware 4 05-11-2011 02:37 PM
[SOLVED] What happens to cron jobs scheduled to run when the PC is suspended? bonixavier Slackware 5 04-07-2011 11:52 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
Domain Name suspended psychobyte Linux - Networking 1 01-18-2006 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration