"Ian" <spam"AT"bathfordhill.co.uk> wrote:
> "Roy Schestowitz" <email@example.com> wrote in message
>> I have been struggling to set up a nightly job that backs up a portion of
>> files. The following is a snippet from my crontab:
>> 28 4 * * * tar czvf /home/roy/Main/Transfer_Archives/rss-`date
>> +%Y-%m-%d`.tar.gz /home/roy/Main/Transfer
>> When I check the status of the task, I observe the following error:
>> /bin/sh: -c: line 1: unexpected EOF while looking for matching ``'
>> /bin/sh: -c: line 2: syntax error: unexpected end of file
>> The command, however, works /fine/ when run normally in the shell.
>> `date +%Y-%m-%d` resolves the error, but does not help me do what I
> want --
>> it overwrites an older file.
>> Any help appreciated,
>> Roy Schestowitz
> Got to admit i had simlar problems when running the following cron job
> as root
> mv /var/log/asterisk/cdr-csv/Master.csv /var/cdr-rec/cdr/`date +%a%b%d%g
> -d yesterday` -f
> Its now part of a larger job thats in my cron.daily directory and is
> faultless... I know it doesnt help but if your distro has cron directories
> try adding the script file in there..
Could it possibly have anything to do with line wrapping? I checked again
and again but no luck...
This would also explain that line of yours which appears to spill over to a
second line without closing the apostrophe...
I'll have another look. Thanks Ian.