From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QYg1i-00055f-Rs for garchives@archives.gentoo.org; Mon, 20 Jun 2011 15:04:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D8F8A1C090 for ; Mon, 20 Jun 2011 15:04:33 +0000 (UTC) Received: from mail-ew0-f53.google.com (mail-ew0-f53.google.com [209.85.215.53]) by pigeon.gentoo.org (Postfix) with ESMTP id C3B081C01D for ; Mon, 20 Jun 2011 14:47:51 +0000 (UTC) Received: by ewy8 with SMTP id 8so1297455ewy.40 for ; Mon, 20 Jun 2011 07:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=tqX4xorlcB8Du16FTYHnGBdtQDTUwxkZ7g8y9Xxdb68=; b=YrWZABeNIYTzxYKUx8WXTLyRwkY0xp0EkMI0zQUSkuiWVclTJh+OGmDW9nvlsLX3HY Z9/dZ0KR5/pYymbmTx+2p0yfWQ7OuJ7LVpvCm+WYy3uY5YA4fT4HjJ2QJAWKCIViRmFi gNg9glleVdg3gKgksmt89zLImOLdk5Tsz7u2o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=HAaku4Y42017BZ4vJeojVVzEw7bLnlD7W4Kqx1P1Q+U9wdH6ZbMuU7iyeB84OCtSGc 98VNmAZRkPnNsip9wDI+R576kYQFpfhL9nXH/crmTTCYwoiln/zz4I1V7PcXkaAjp7dR PKPx0/fgLSvITRRuds3Lrpm7ACj/L90QrhuoE= 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 Received: by 10.14.52.80 with SMTP id d56mr1985448eec.161.1308581270918; Mon, 20 Jun 2011 07:47:50 -0700 (PDT) Received: by 10.14.185.131 with HTTP; Mon, 20 Jun 2011 07:47:50 -0700 (PDT) In-Reply-To: <1426203.rtguKxDEjI@nazgul> References: <1426203.rtguKxDEjI@nazgul> Date: Mon, 20 Jun 2011 07:47:50 -0700 Message-ID: Subject: Re: [gentoo-user] crontab not executing From: Grant To: Gentoo mailing list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 955fe0523e986431789f98659293a742 >> One of my systems has a crontab like this to clean up and >> consolidate the output of the video monitoring app "motion": >> >> # crontab -l >> # DO NOT EDIT THIS FILE - edit the master and reinstall. >> # (/home/grant/cron.root.txt installed on Sat Sep 25 10:42:18 2010) >> # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 >> vixie Exp $) 50 23 * * * /bin/rm /home/motion/$(date -d 'yesterday' >> +%Y%m%d)*.jpg 55 23 * * * /bin/rm /home/motion/$(date -d >> 'yesterday' +%Y%m%d)*.avi 59 23 * * * /usr/bin/mencoder >> /home/motion/$(date +%Y%m%d)*.avi -noidx -o >> /home/motion/full-$(date +%Y%m%d).avi -ovc copy -oac copy >> >> If I execute each command manually, it works great, but nothing >> happens otherwise. =A0Can someone tell me why this crontab doesn't >> seem to be executing? > > crontab does not use the same shell you use, so when your crons run > they are missing all of the niceties you are used to using yourself. > > Things like PATH for example, and the $() may or may not work. > > You have paths for rm and mencoder but not for date I've switched to this but I can't find the date binary. Does anyone know the full path for date? 50 23 * * * /bin/rm /home/motion/`date -d 'yesterday' +\%Y\%m\%d`*.jpg 55 23 * * * /bin/rm /home/motion/`date -d 'yesterday' +\%Y\%m\%d`*.avi 59 23 * * * /usr/bin/mencoder /home/motion/`date +\%Y\%m\%d`*.avi -noidx -o /home/motion/full-`date +\%Y\%m\%d`.avi -ovc copy -oac copy - Grant