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 B2BF5138A1A for ; Thu, 5 Feb 2015 19:44:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 45642E094F; Thu, 5 Feb 2015 19:44:44 +0000 (UTC) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D66DBE0944 for ; Thu, 5 Feb 2015 19:44:42 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id y19so9454469wgg.11 for ; Thu, 05 Feb 2015 11:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=MPcG6A0mfNnZZnBdBZ5Ro+rAzAPWlX0cc6c5JLRholI=; b=F+D9Nd4PWPSOPTeUPhLL6lNxqmBt+XtXZfIu1aSy4QcY36APnWd8K84rXmHT4Ccj7q Gt10dqOgURDZI33dPVzGSLynDcdvxX7lbdSfvdtlhsvAgynSFcPY0e8Hn++8Rd/zo/be dRAQ45YyUEYZkiU3FyxGfiI/bk5/SJ3F+7p5gHi+EVSglmfP2GfiwOZwDbMx4JiVVs0x BKdjg7ufzOKLQZJk66qDvp4WC+a8gOYsAToyKz6lYZfcgg6myCRENCXmRmcwuXCQXRlI nKfu5w/DOrZcQcsOT0G2cy8hUpfk5oOYqWVEZyQk9WgdYYUk/ZM8pUp1bKrajxG9072u REUg== X-Received: by 10.194.170.161 with SMTP id an1mr11277683wjc.126.1423165481676; Thu, 05 Feb 2015 11:44:41 -0800 (PST) Received: from [172.20.0.41] (105-237-231-57.access.mtnbusiness.co.za. [105.237.231.57]) by mx.google.com with ESMTPSA id tc2sm4552wic.21.2015.02.05.11.44.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 11:44:41 -0800 (PST) Message-ID: <54D3C7EC.8070400@gmail.com> Date: Thu, 05 Feb 2015 21:43:40 +0200 From: Alan McKinnon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 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] cron - once a month during week days References: <20150205191913.GA29686@syscon7> In-Reply-To: <20150205191913.GA29686@syscon7> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Archives-Salt: 5ab6b7e9-80cd-44ac-bcf8-329cc7693e8f X-Archives-Hash: b042ae3258f08afd2b737f7cf13c54f3 On 05/02/2015 21:19, Joseph wrote: > I have a cron tab entry: > 8 12 1-7 * 1 rsync ... > > I was under impression that it will run once a month on Monday but it > seems to be running every day, why? > As Florian explained, crontab syntax gets weird when you use fields 3 and 5. Basically, what you want to do cannot be done in a plain crontab. You might be able to leverage anacron to accomplish what you want. Otherwise, you must write a wrapper script that runs daily or on Mondays and checks a flag file that it creates and only run once in a given month -- Alan McKinnon alan.mckinnon@gmail.com