problem with bash script
Paolo De Michele
paolo at paolodemichele.it
Sat Mar 8 16:56:05 UTC 2014
hi everybody,
I have a problem with my bash script.
this script will do a backup in a particular directory - look below:
#
BCK_FILE=/backup/www/test
destinatario=alert at piludu.it
sites=("client1/web1" "client1/web2")
sito=("1" "2")
tLen=${#sites[@]}
for (( i=0; i<${tLen}; i++ ));
do
cd /var/www/clients/
cp -R ${sites[$i]} /backup/temp/www/
cd /backup/temp/www/
tar cfz `date +%F`_web${sito[$i]}.tar.gz web${sito[$i]}/
mv *.tar.gz /backup/www/test/
rm -rf /backup/temp/www/*
done
if I start this script.sh in my console
# ./script.sh it works
but if I schedule it in my crontab doesn't work
what is the problem?
can I fix it?
thanks in advance
regards
More information about the ubuntu-users
mailing list