problem with bash script

Hans Muecke ubuntu-ml01 at filderstadtweather.eu
Sat Mar 8 17:07:17 UTC 2014


Am 08.03.2014 16:56, schrieb Paolo De Michele:

Hi Paolo,

Just a wild guess ... does the cron start "./script.sh" or
"/path/to/script.sh"? The latter one should be used, if the script is
not located in you $PATH.


> <pre wrap>
>
> 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
>
>
> </pre></body>
> </html>
> </html>

-- 
Talk to you later ... Hans (195 to go)


2014/03/08 16:50
EDDS 081650Z 10006KT CAVOK 12/M00 Q1030 NOSIG





More information about the ubuntu-users mailing list