DO NOT REPLY [Bug 6209] rsync exiting suddenly
samba-bugs at samba.org
samba-bugs at samba.org
Fri Mar 27 10:29:28 GMT 2009
https://bugzilla.samba.org/show_bug.cgi?id=6209
------- Comment #2 from mathieu.coavoux at aktor.fr 2009-03-27 05:29 CST -------
Thanks for your answer.
I use the crontab which launch the script bellow :
#!/bin/bash
backup_conf=backup_notebook.conf
SMBLOGIN=administrateur
SMBPWD=*****
MOUNTDIR="/tmp/smbmnt"
daytosave=7
oneweekago=`date -d "-$daytosave day" +%F`
deltaday=1
# if yesterday was sunday, computer was halted, so use friday's save
yesterday=`date -d '-1 day' +%w`
if [ $yesterday -eq 0 ]
then
deltaday=3
fi
lastday=`date -d "-$deltaday day" +%F`
today=`date +%F`
echo "Begin `date`"
if [ ! -d $MOUNTDIR ]
then
mkdir $MOUNTDIR
fi
umount $MOUNTDIR
#IFS="\n"
IFS=$'\012'
for line in `grep -v "#" $backup_conf`
do
BWS=`echo $line | cut -f1 -d":"`
BDISK=`echo $line | cut -f2 -d":"`
BDIR=`echo $line | cut -f3 -d":"`
echo "Mount $BWS/$BDISK"
mount -t cifs -o username=$SMBLOGIN,password=$SMBPWD,workgroup=$BWS,ro
//$BWS/$BDISK $MOUNTDIR
if [ $? -eq 0 ]
then
BACKUP_HOME="/data/backup/workstations/$BWS"
OPTS="-av --force --ignore-errors --delete --numeric-ids --link-dest
$BACKUP_HOME/$lastday "
if [ ! -d $BACKUP_HOME ]
then
echo "Create dir $BACKUP_HOME"
mkdir -p $BACKUP_HOME
fi
echo "Delete old save of $BWS ($BACKUP_HOME/$oneweekago)"
rm -rf $BACKUP_HOME/$oneweekago
echo "Snapshot of $BWS : $BDIR in $BACKUP_HOME/$today"
echo "rsync $OPTS $MOUNTDIR/$BDIR $BACKUP_HOME/$today"
rsync -av --force --delete --ignore-errors --numeric-ids --link-dest
$BACKUP_HOME/$lastday "$MOUNTDIR/$BDIR" $BACKUP_HOME/$today >>
/var/log/backup/backup.$BWS.log
sleep 5
echo "Unmount $BWS/$BDISK"
umount $MOUNTDIR
else
echo "$today : $BWS not accessible" >> notebook_failed.log
fi
done
echo "End `date`"
Here there is no debug option, however even I set -vvv as I said there is no
other errors.
It seems to abort such as a time out or an unsychronization.
This backup occurs while the lunchtime, employees follow to work or use their
laptops. I don't think that this problem is due to laptops are working.
There is another backup of the workstations while the night, there is no
problem with this one.
Thanks for your help (sorry for my english)
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
More information about the rsync
mailing list