Re: Help with a bash script please
On 01/14/2011 10:33 AM, Adrian Levi wrote:
> I have the following bash script and it fails at line 14 and 15
> (7zparameters= and 7zfilename=) I have tried everything i can think of
> to get it to work, the answer has to be simple but i can't figure it.
> This is going to be my new backup script, based on an earlier version
> that is very similar in functionality except I wasn't using tar, in
> that version.
> # Variables:
> # Determine backup level
> if [ -f $incrementalfile ]
> backuplevel=`date +%w`
> rm $incrementalfile> /dev/null 2>&1
> 7zparameters='a -si -mhe=on -ppassword -t7z -m0=lzma -mx=9 -mfb=64
> -md=32m -ms=on -l'
Variable names can't start with a digit (as in 7zfilename=...).
> 7zfilename='Daily backup - `date +%a" "%h" "%H%M"
The single quotes will prevent the date command from happening. So you
need to use double quotes.