View previous topic :: View next topic |
Author |
Message |
liinnu n00b
Joined: 30 Oct 2010 Posts: 8
|
Posted: Mon Nov 15, 2010 3:52 pm Post subject: [solved]anacron and vixie-cron |
|
|
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 |
|
|
dermund Apprentice
Joined: 28 Aug 2007 Posts: 205 Location: Sprawl
|
Posted: Tue Nov 30, 2010 4:04 pm Post subject: |
|
|
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 |
|
|
iss Tux's lil' helper
Joined: 30 Oct 2006 Posts: 134 Location: Poland/Bydgoszcz
|
Posted: Wed Dec 01, 2010 7:59 am Post subject: |
|
|
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 |
|
|
|