Bug 6209 - rsync exiting suddenly
rsync exiting suddenly
Status: NEW
Product: rsync
Classification: Unclassified
Component: core
3.0.5
x86 Linux
: P3 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-24 05:21 UTC by m.coavoux
Modified: 2010-08-22 06:28 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description m.coavoux 2009-03-24 05:21:47 UTC
Hello,
This trouble doesn't occurs each backup.
While rsync transfert data from a laptop to a server, it stop to backup the currently laptop and goes through the backup notebook list.
The next laptop isn't backing up, rsync creates only the tree for the first level.
All of this backup exiting with this error :

_exit_cleanup(code=13, file=log.c, line=237): entered
_exit_cleanup(code=13, file=log.c, line=237): about to call exit(13)

There is no other error message, I can't fix where the problem comes from.
I checked what the code 13 means, I've just found that :
Errors with program diagnostics

Any idea ?

Thanks
Comment 1 Matt McCutchen 2009-03-26 12:43:49 UTC
From the output, it looks like rsync encountered some sort of error and then aborted because it was unable to print the error message to stderr.  Perhaps stderr got closed somehow.

What is the full command line of the rsync run that is failing?  And how is rsync being invoked?  If it's from a script, please post the script.
Comment 2 m.coavoux 2009-03-27 05:29:28 UTC
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)
Comment 3 roland 2010-08-22 06:28:57 UTC
you may add 2>>/var/log/backup/backup.$BWS.log.err to your rsync line in that script to get the stderr redirected to backup.$BWS.log.err

if there is something wrong with the stderr, this may fix it or you should at least be able to see appropriate error messages. mind that stderr in cron is typically redirected to be sent via email