From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0A6201381F3 for ; Sun, 21 Apr 2013 20:33:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 119BDE091D; Sun, 21 Apr 2013 20:33:42 +0000 (UTC) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8A6E5E08F4 for ; Sun, 21 Apr 2013 20:33:40 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id l13so3293469wie.4 for ; Sun, 21 Apr 2013 13:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=lDwpy80/324MG/xRm4my8gUnL5U1sJyaI7zIC5E43uY=; b=c+3ncORtVHN5jkxm/8R7EWh61lCB/6lHLW7vZ1+L1dwMLpMptzYc4MhbPkiyKy7KGo YRNCFElfuxIZiGjP2cPCm7gF3UOIpjWNvC/GgGDyZcMQiWenyglTTj/c22WvEWYAuYLv DJoXrBkuvzqvySIC3dEtH1Nf6ku6s3xfEcDDAQ5+iqLWhhNqgCV0AJD8Vn+MZ/9vjG4u kd2jmpblW/zZ1dPs5ERwUql4NEKXSCleiW9kfy8ixiQeHXZVKdsFMaqcBzMFoIGuQHCg A+frvPEtkcaWnOfc49GoiyNOEYkchtzBjIorruJnR09+y93jqk8qy8Aiz9B8tB92RjVc RvPg== X-Received: by 10.194.119.33 with SMTP id kr1mr45689191wjb.36.1366576419207; Sun, 21 Apr 2013 13:33:39 -0700 (PDT) Received: from [172.20.0.41] (196-215-203-210.dynamic.isadsl.co.za. [196.215.203.210]) by mx.google.com with ESMTPSA id j10sm16260124wie.1.2013.04.21.13.33.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Apr 2013 13:33:38 -0700 (PDT) Message-ID: <51744CF6.80305@gmail.com> Date: Sun, 21 Apr 2013 22:32:54 +0200 From: Alan McKinnon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130413 Thunderbird/17.0.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Hows this for rsnapshot cron jobs? References: <5174345C.9080304@libertytrek.org> In-Reply-To: <5174345C.9080304@libertytrek.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 51d861d8-6673-44d0-9085-3faf327c63c4 X-Archives-Hash: b8ced9d698834bd5ea8d43b658527586 On 21/04/2013 20:47, Tanstaafl wrote: > Ok, my goal is to keep 3 'snapshots' per day (11:30am, 2:30pm and > 5:30pm), 7 daily's (8:50pm), 4 weekly's (8:40pm), 12 monthly's (8:30pm), > and 5 yearly's (8:20pm). > > My myhost1.conf has: > > interval hourly 3 > interval daily 7 > interval weekly 4 > interval monthly 12 > interval yearly 5 > > And my /etc/crontab now looks like: > >> # for vixie cron >> # $Header: >> /var/cvsroot/gentoo-x86/sys-process/vixie-cron/files/crontab-3.0.1-r4,v 1.3 >> 2011/09/20 15:13:51 idl0r Exp $ >> >> # Global variables >> SHELL=/bin/bash >> PATH=/sbin:/bin:/usr/sbin:/usr/bin >> MAILTO=root >> HOME=/ >> >> # check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly >> 59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly >> 9 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily >> 19 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly >> 29 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly >> */10 * * * * root test -x /usr/sbin/run-crons && >> /usr/sbin/run-crons >> # >> # rsnapshot cronjobs >> # >> 30 11,14,17 * * * root rsnapshot -c /etc/rsnapshot/myhost1.conf >> sync; rsnapshot -c /etc/rsnapshot/myhost1.conf hourly >> 50 20 * * * root rsnapshot -c /etc/rsnapshot/myhost1.conf daily >> 40 20 * * 6 root rsnapshot -c /etc/rsnapshot/myhost1.conf weekly >> 30 20 1 * * root rsnapshot -c /etc/rsnapshot/myhost1.conf monthly >> 20 20 1 * * root rsnapshot -c /etc/rsnapshot/myhost1.conf yearly Only the last line is wrong - your monthly and yearly are equivalent.To be properly yearly, you need a month value in field 4. I'm not familiar with rsnapshot, I assume that package can deal with how many of each type of snapshot to retain in it's conf file? I see no crons to delete out of date snapshots. And, more as a nitpick than anything else, I always recommend that when a sysadmin adds a root cronjob, use crontab -e so it goes in /var/spool/cron, not /etc/crontab. Two benefits: - syntax checking when you save and quit - if you let portage, package managers, chef, puppet or whatever manage your global cronjobs in /etc/portage, then there's no danger that system will trash the stuff that you added there manually. -- Alan McKinnon alan.mckinnon@gmail.com