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, 06:11 PM   #1
nix.noob
LQ Newbie
 
Registered: Aug 2013
Posts: 25

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, 06:14 PM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,385

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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-02-2014, 12:32 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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, 06:59 AM   #4
nix.noob
LQ Newbie
 
Registered: Aug 2013
Posts: 25

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 03:37 PM
[SOLVED] What happens to cron jobs scheduled to run when the PC is suspended? bonixavier Slackware 5 04-08-2011 12:52 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 09: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 02:57 AM
Domain Name suspended psychobyte Linux - Networking 1 01-18-2006 08:00 PM


All times are GMT -5. The time now is 06:33 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration