Fwd: Cron <root at hXXXXXX> tar cfCz /root/backups/htdocs-`date +

Sjoerd Mullender sjoerd at acm.org
Fri Oct 6 13:06:15 UTC 2006


On 2006-10-06 14:48, Alexander Farber wrote:
> Hello,
> 
> could someone please advise me, why would
> my tar-command work fine on the command line:
> 
> hXXXXXX:afarber {272} sudo tar cfCz /root/backups/htdocs-`date
> +%F`.tgz /var/www/htdocs .
> hXXXXXX:afarber {273} sudo ls -l /root/backups
> -rw-r--r-- 1 root root 1087070 Oct  6 14:43 htdocs-2006-10-06.tgz
> 
> But fails in the root's crontab:
> 
> h754814:afarber {274} sudo crontab -l
> 3       3       *       *       *       tar cfCz
> /root/backups/htdocs-`date +%F`.tgz /var/www/htdocs .
> 
> Thank you
> Alex
> 
> 
> ---------- Forwarded message ----------
> From: Cron Daemon <alexander.farber at gmail.com>
> Date: Oct 6, 2006 3:03 AM
> Subject: Cron <root at h754814> tar cfCz /root/backups/htdocs-`date +
> To: root at hXXXXXX.serverkompetenz.net
> 
> 
> /bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
> /bin/sh: -c: line 1: syntax error: unexpected end of file
> 
> 

The percent is special in a crontab command.  Check the manual (man 5
crontab).

-- 
Sjoerd Mullender

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 370 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20061006/73b6da25/attachment-0001.sig>


More information about the fedora-list mailing list