On 14.01.2011 11:37, Adrian Levi wrote:
I have (hopefully) taken on everybody's suggestions, Here is the
current script :)


#!/bin/sh

# Variables:
# Determine backup level
incrementalfile="/srv/tar_incremental_file"

if [ -f $incrementalfile ]
then
backuplevel="date +%w"

you want:
backuplevel="`date +%w`"
or:
backuplevel="$(date +%w)"

else
backuplevel="0"
rm $incrementalfile>  /dev/null 2>&1
always quote file names with double quotes.
put a space before the redirection.

fi

zparameters="a -si -mhe=on -ppassword -t7z -m0=lzma -mx=9 -mfb=64
-md=32m -ms=on -l"
zfilename="Daily backup - $(date +"%a %h %H%M %d-%m-%Y").$backuplevel.tar.7z"
backuppath="/srv/allsocool /etc"
backupslocation="/srv/backups"

tarparameters="cf - --listed-incremental=$incrementalfile"


# cd to directory for output file
cd $backupslocation

quotes.

#tar $tarparameters $backuppath | 7z $zparameters $zfilename
quote path and filename.

tar $tarparameters $backuppath | 7z a -si test.tar.7z

quote path and filename.

[not read]

best regards

mart


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4d303ac4.2020...@chello.at

Reply via email to