On Thu, Nov 08, 2012 at 08:16:13AM -0200, Friedrich Locke wrote: > Dear member list, > > i am running a backup script. When i exec it from a login shell it works > nicely altough it shows a message about a file being modified during copy > to archive. > > The backup is performed ok, but when i schedule the script to be executed > by cron, it stops executing at the first file being modified during copy to > archive. > > May someone point me my mistaken ?
Make sure all commands you run are in you PATH. Default PATH for crontab is: PATH=/bin:/sbin:/usr/bin:/usr/sbin and for e.g. curl is not in there. > > Thanks in advance. > > Here you have the output executing it from a terminal: > > # > /etc/backup/bk-paginas.sh > > tar: Removing leading / from absolute path names in the archive > % Total % Received % Xferd Average Speed Time Time Time > Current > Dload Upload Total Spent Left > Speed > 0 0 0 0 0 0 0 0 --:--:-- --:--:-- > --:--:-- 0 > tar: File /home/_syslogd/httpd.acs was modified during copy to archive > 100 281M 0 0 0 281M 0 11.5M --:--:-- 0:00:24 --:--:-- > 10.6M > # > > Here you have the script itself: > > #!/bin/sh > > #Calculando Datas > DIA_MES=`date +%d` > MES=`date +%b` > ANO=`date +%Y` > > #Gerando Caminhos e Nomes dos Arquivos > NOME_SERVIDOR='LOKI' > PAGINAS_ORIG1='/home/_syslogd' > PAGINAS_ORIG2='/var/log' > PAGINAS_DEST='/var/tmp' > PAGINAS_DEST_DIARIO='/var/tmp' > > # Compactando as pastas > rm -f $PAGINAS_DEST_DIARIO/*PAGINAS*.gz > > #tar -czvf > $PAGINAS_DEST_DIARIO/$NOME_SERVIDOR-PAGINAS_$ANO$MES$DIA_MES.tar.gz > $PAGINAS_ORIG1 $PAGINAS_ORIG2 > > $PAGINAS_DEST/$NOME_SERVIDOR-PAGINAS-LOG_$ANO$MES$DIA_MES.log > tar -czvf $PAGINAS_DEST_DIARIO/p $PAGINAS_ORIG1 $PAGINAS_ORIG2 > > $PAGINAS_DEST/$NOME_SERVIDOR-PAGINAS-LOG_$ANO$MES$DIA_MES.log & > > #cp -f $PAGINAS_DEST_DIARIO/*PAGINAS*.gz $PAGINAS_DEST/. > > # Envio para o LAMPIAO via FTP > cat $PAGINAS_DEST_DIARIO/p | curl -T - > ftp://bk_sysop:xxxyyy...@lampiao.cpd.ufv.br/linux/$NOME_SERVIDOR/$NOME_SERVIDOR-PAGINAS_$ANO$MES$DIA_MES.tar.gz&& > echo 'Envio OK' | mail -s 'OK - LOKI - PAGINAS' > backup-...@ufv.br || echo 'Envio ERRO' | mail -s 'ERRO - LOKI - PAGINAS' > backup-...@ufv.br > -- Antoine