1 |
On 21/04/2013 22:49, Tanstaafl wrote: |
2 |
> On 2013-04-21 4:32 PM, Alan McKinnon <alan.mckinnon@×××××.com> wrote: |
3 |
>> On 21/04/2013 20:47, Tanstaafl wrote: |
4 |
>>>> 30 20 1 * * root rsnapshot -c /etc/rsnapshot/myhost1.conf |
5 |
>>>> monthly |
6 |
>>>> 20 20 1 * * root rsnapshot -c /etc/rsnapshot/myhost1.conf yearly |
7 |
> |
8 |
>> Only the last line is wrong - your monthly and yearly are equivalent.To |
9 |
>> be properly yearly, you need a month value in field 4. |
10 |
> |
11 |
> Oh, right (I added that interval myself, rsnapshot only comes with the |
12 |
> hourly, daily weekly and monthly by default). |
13 |
> |
14 |
> So, if I wanted it to run at 8:20pm on Dec 31, it would be: |
15 |
> |
16 |
> 20 22 31 12 * root rsnapshot -c /etc/rsnapshot/myhost1.conf yearly |
17 |
|
18 |
|
19 |
Correct |
20 |
|
21 |
|
22 |
|
23 |
>> I'm not familiar with rsnapshot, I assume that package can deal with how |
24 |
>> many of each type of snapshot to retain in it's conf file? I see no |
25 |
>> crons to delete out of date snapshots. |
26 |
> |
27 |
> Correct, rsnapshot handles this. |
28 |
> |
29 |
>> And, more as a nitpick than anything else, I always recommend that when |
30 |
>> a sysadmin adds a root cronjob, use crontab -e so it goes in |
31 |
>> /var/spool/cron, not /etc/crontab. Two benefits: |
32 |
>> |
33 |
>> - syntax checking when you save and quit |
34 |
>> - if you let portage, package managers, chef, puppet or whatever manage |
35 |
>> your global cronjobs in /etc/portage, then there's no danger that system |
36 |
>> will trash the stuff that you added there manually. |
37 |
> |
38 |
> I prefer doing things manually... so, nothing else manages my cron jobs. |
39 |
> |
40 |
> That said, I prefer to do this 'the gentoo way'... so is crontab -e the |
41 |
> gentoo way? |
42 |
|
43 |
|
44 |
There's no "gentoo way" for this :-) |
45 |
|
46 |
Admittedly, things have changed over the years, most distros now have |
47 |
the equivalent of "cron.daily" etc that cron jobs get installed into, |
48 |
leaving the main /etc/crontab as a place to put the lastrun logic. It |
49 |
wasn't always like that though. |
50 |
|
51 |
If you ever move to puppet or similar to do your configs you'll want to |
52 |
revisit this. Meanwhile, as you do everything manually anyway, your |
53 |
current method seems to work just fine for you |
54 |
|
55 |
|
56 |
-- |
57 |
Alan McKinnon |
58 |
alan.mckinnon@×××××.com |