problem with bash script

Chris Green cl at isbd.net
Sat Mar 8 17:21:30 UTC 2014


On Sat, Mar 08, 2014 at 04:56:05PM +0000, Paolo De Michele wrote:
> 
> 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 
> 
If you tell us the error message returned when you run it from the
crontab it would be easier to diagnose.  The error message should be
E-Mailed to you.  If the error message doesn't arrive then you need to
get that working first!  :-)

-- 
Chris Green




More information about the ubuntu-users mailing list