[ale] cron vs. command line

Christopher Bergeron christopher at bergeron.com
Sat Oct 26 14:53:37 EDT 2002


Might try substituting $(date +%m-%d-%y) with `date +%m-%d-%y`.  Also,
I'm not sure if the $HOME variable is set when cron runs (it doens't
have your user land vars set).  Try putting in the absolute pathname
instead of $HOME.

HTH,
-CB



Saturday, October 26, 2002, 11:46:26 AM, you wrote:

JPKI> Put the entire bash stuff in a script file and have cron call it to run.

JPKI> On Sat, 2002-10-26 at 11:40, Denny Chambers wrote:
>> Hi All,
>> 
>>       I have put together a simple backup script to back up my home directory 
>> on my development box. I have it scheduled to run in a cron job. The 
>> problem is that what I tested on the command line, does not work in the 
>> cron job. I am sure I am missing something simple here.
>> 
>> Here is the crontab entry:
>> 5 0 * * *       $HOME/bin/backup.sh >> 
>> $HOME/logs/backuplog-${HOSTNAME}-$(date +%m-%d-%y).log 2>&1
>> 
>> 
>> here is the error i get in my inbox:
>> Subject: Cron <dchambers at honeybee> $HOME/bin/backup.sh >> 
>> $HOME/logs/backuplog-${HOSTNAME}-$(date +
>> 
>> /bin/sh: -c: line 1: unexpected EOF while looking for matching `)'
>> /bin/sh: -c: line 2: syntax error: unexpected end of file
>> 
>> 
>> is there some thing wrong with this:$(date +%m-%d-%y)
>> 
>> or is there a limit on the command length in a crontab file????
>> 
>> Thanks,
>> Denny
>> 
>> 
>> ---
>> This message has been sent through the ALE general discussion list.
>> See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
>> sent to listmaster at ale dot org.


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list