[Cialug] shell script error

Dave Weis djweis at sjdjweis.com
Fri Aug 26 14:08:38 CDT 2005


Small edit below

On Fri, 26 Aug 2005, Chris Hettinger wrote:

> #!/bin/sh
>
> TODAY=`date +%Y%m%d`
         ^            ^

You need backquotes to insert the output of the date command into a 
variable.

> MYSQLDUMP=/usr/bin/mysqldump
> MYSQLUSER=mysqluser
> MYSQLPASS=mysqlpass
>
> ${MYSQLDUMP} -u ${MYSQLUSER} --password=${MYSQLPASS} database1 > 
> /home/chris/mysql_data/database1${TODAY}.sql
>
> ---------Where I run the above script it prompts:
>
> [u at h chris]# sh mysql_data_backup.sh
> mysql_data_backup.sh: line 5: +%Y%m%d: command not found
>
> ---------Help.
>
> -ch
>
>
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>

-- 
Dave Weis             "I believe there are more instances of the abridgment
djweis at sjdjweis.com   of the freedom of the people by gradual and silent
                       encroachments of those in power than by violent
                       and sudden usurpations."- James Madison


More information about the Cialug mailing list