fmcroce
(usa Fedora)
Enviado em 21/10/2008 - 14:50h
tenho um script de backup que quando eu copio o conteudo e colo no terminal ele executa perfeitamente, mas quando eu mando executar o arquivo usando ./script, dá um erro em um for que tenho.
segue script.
d=`date +%Y%m%d%H%M`
echo Executando Backup de Moai-Menphis Metal Linea Indaiatuba >/BACKUP/metallinea/mensal/bkpmes_galusse.log
echo >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
echo Iniciando em: `date +%Y%m%d%H%M` >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
echo >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
echo Copiando Sistemas... >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
tar zcvf /BACKUP/metallinea/mensal/sistemas-$d.tar.gz /SISTEMAS >>/BACKUP/metallinea/mensal/sistemas-$d.tar.log 2>>/BACKUP/metallinea/mensal/sistemas-$d.tar.log
echo Copiando Show Room Indaiatuba... >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
for i in `ls /SHOWRIDT|grep -v lost+found`
do
echo tar zcvf /BACKUP/metallinea/mensal/showridt-$i-$d.tar.gz /SHOWRIDT/$i >>/BACKUP/metallinea/mensal/showridt-$i-$d.tar.log 2>>/BACKUP/metallinea/mensal/showridt-$i-$d.tar.log
done
echo Copiando Metallinea... >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
for i in `ls /METALLINEA`
do
echo " $i..." >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
tar zcvf /BACKUP/metallinea/mensal/metallinea-$i-$d.tar.gz /METALLINEA/$i >>/BACKUP/metallinea/mensal/metallinea-$i-$d.tar.log 2>>/BACKUP/metallinea/mensal/metallinea-$i-$d.tar.log
done
echo >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
echo Copiando Areas de Usuários... >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
for i in `ls /HOME` do
echo " $i..." >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
tar zcvf /BACKUP/metallinea/mensal/home-$i-$d.tar.gz /HOME/$i >>/BACKUP/metallinea/mensal/home-$i-$d.tar.log 2>>/BACKUP/metallinea/mensal/home-$i-$d.tar.log
done
echo >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
echo Finalizado em: `date +%Y%m%d%H%M` >>/BACKUP/metallinea/mensal/bkpmes_galusse.log
segue o erro:
[root@MLFILESERVER metallinea]# ./bkpmes_galusse
'/bkpmes_galusse: line 15: syntax error near unexpected token `do
'/bkpmes_galusse: line 15: `do
[root@MLFILESERVER metallinea]#
sera que alguem teria uma luz????