[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: crontab and command expansion problem



On Wed, Apr 07, 2004 at 10:34:06AM +0800, Isaac Claymore wrote:
> WEEK_DAY=`date +\%A`
> 30 23 * * * mount /backup && mysqldump --password=FOOBAR --all-databases > /backup/alldb-${WEEK_DAY}.sql; umount /backup
> 
> It's been working on RH system, but the Debian cron keeps refusing to do command
> expansion on WEEK_DAY, i.e. the script produces a file named: alldb-`date +\%A`.sql
> 
> Any hint?

A little on the simple-minded side, but have you considered just not
using the variable?  I have a cron job that does

12 4 * * 2 /some/script | mail -s "Info for `date +'\%B \%-d, \%Y'`" ad@dr.ess

and it has never given me any trouble.

-- 
The freedoms that we enjoy presently are the most important victories of the
White Hats over the past several millennia, and it is vitally important that
we don't give them up now, only because we are frightened.
  - Eolake Stobblehouse (http://stobblehouse.com/text/battle.html)



Reply to: