From owner-freebsd-questions Mon Jan 14 8:30:38 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dire.bris.ac.uk (dire.bris.ac.uk [137.222.10.60]) by hub.freebsd.org (Postfix) with ESMTP id AED9037B41D for ; Mon, 14 Jan 2002 08:29:03 -0800 (PST) Received: from mail.ilrt.bris.ac.uk by dire.bris.ac.uk with SMTP-PRIV with ESMTP; Mon, 14 Jan 2002 16:28:53 +0000 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 3.16 #1) id 16Q9wT-0002gy-00; Mon, 14 Jan 2002 16:26:37 +0000 Date: Mon, 14 Jan 2002 16:26:36 +0000 (GMT) From: Jan Grant X-X-Sender: To: ann kok Cc: questions Subject: Re: crontab to backup mail in date format In-Reply-To: <20020114161715.86067.qmail@web20101.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 14 Jan 2002, ann kok wrote: > Hi all > > I have problem about crontab to backup mail in date > format > > error from root: > /bin/sh: unexpected EOF while looking for ``' > >/bin/sh: -c: line 2: syntax erro > > > My contrab is as follows: > > 5 21 * * * tar czvf /backup/`date > "+%Y-%m-%d"`home.tar.gz /home > /dev/null 2>&1 > 59 23 * * * tar cvf /backup/`date > "+%Y-%m-%d"`backupmail.tar /mail > /dev/null 2>&1 % characters in crontab are turned into newlines when the whole thing is sent to the shell; turn the command line into a little script and call that from cron. -- jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/ Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk Strive to live every day as though it was last Wednesday. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message