Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]anacron and vixie-cron
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
liinnu
n00b
n00b


Joined: 30 Oct 2010
Posts: 8

PostPosted: Mon Nov 15, 2010 3:52 pm    Post subject: [solved]anacron and vixie-cron Reply with quote

hey guys,

I have a question about anacron. For my backup, I use rsnapshot with vixie-cron. Here is the output of crontab -l

Code:
localhost jp,e # crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXSqyQmk installed on Mon Nov 15 16:18:47 2010)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
0   20   *   *   *   /usr/bin/emerge --sync
20   16   *    *    1   /usr/bin/rsnapshot weekly
0    18    1    *    *       /usr/bin/rsnapshot monthly
0   20   1   1   *   /usr/bin/rsnapshot yearly


I add anacron & vixie-cron to the default run-level. So, do I have to add the following line to the crontab, listed above:

Code:
30   18   *   *   *   /usr/sbin/anacron -s


or is it enough to add anacron to the default run-level? Here's my /etc/anacrontab

Code:
  GNU nano 2.2.4            File: /etc/anacrontab                               
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# format: period delay job-identifier command
##
## If you turn any of the following on, make sure that the
## regular cron daemon does not run them also. This could
## lead to double execution of the jobs.
#1       5       cron.daily      run-parts /etc/cron.daily
7       10      rsnapshot.weekly        /usr/bin/rsnapshot weekly
30      15      rsnapshot.monthly       /usr/bin/rsnapshot monthly
365     50      rsnapshot.yearly        /usr/bin/rsnapshot yearly


To be more precisely: will anacron run a "forgotten" backup, by just adding anacron to the default run-level or should I also add the extra command line for anacron to the crontab?
Thx for help!

cheers

liinnu


Last edited by liinnu on Wed Dec 01, 2010 8:12 am; edited 1 time in total
Back to top
View user's profile Send private message
dermund
Apprentice
Apprentice


Joined: 28 Aug 2007
Posts: 205
Location: Sprawl

PostPosted: Tue Nov 30, 2010 4:04 pm    Post subject: Reply with quote

Hi liinnu,

In case you haven't found a solution until now, I suggest you read at least this part of the gentoo cron-guide.
Altough I don't know rsnapshot, I think using cronbase directories may be suitable for your task.


Have a nice day

dermund
Back to top
View user's profile Send private message
iss
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2006
Posts: 134
Location: Poland/Bydgoszcz

PostPosted: Wed Dec 01, 2010 7:59 am    Post subject: Reply with quote

I don't think you need to run anacron from cron.

AFAIK you can run anacron without cron. It can be used as cron replacement for machines which don't run 24/7.

Cron run commands precisely at desired time.
Anacron checks if command was executed during scheduled period. If not it runs it after delay set in anacron file.

As you can see in anacron config file you can run cron jobs with it.
Daily cron job is set to run in the middle of the night. If your machine is not running then it will be not executed. With anacron it can be executed as soon as your machine boot. Of course to avoid running it twice you should remove daily job from cron then.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum