[Gllug] rsync problems

sharon kimble boudiccas at talktalk.net
Mon Dec 19 02:43:57 UTC 2011


i run the following script every three hours to back up to my usb external 
hard drive ;-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/bash -x
#shell script for use with rsync in user crontab
if [ -d /media/8eef3b99-c17b-4913-ae61-d34c7fd5d459/ ]; then
   /usr/bin/rsync -avz --exclude-from '/home/boztu/cron/xclude.txt' 
/home/boztu/ /media/8eef3b99-c17b-4913-ae61-d34c7fd5d459/`/bin/date 
+%Y%m%d`/ \
   >> /home/boztu/cron/backup.txt
fi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
which works very well, except for at midnight when it refuses to run showing 
me this in the failed message;-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ '[' -d /media/8eef3b99-c17b-4913-ae61-d34c7fd5d459/ ']'
++ /bin/date +%Y%m%d
+ /usr/bin/rsync -avz --exclude-from /home/boztu/cron/xclude.txt /home/boztu/
+/media/8eef3b99-c17b-4913-ae61-d34c7fd5d459/20111218/
rsync: writefd_unbuffered failed to write 4092 bytes to socket [sender]: Broken
+pipe (32)
rsync: mkdir "/media/8eef3b99-c17b-4913-ae61-d34c7fd5d459/20111218" failed:
+Permission denied (13)
rsync error: error in file IO (code 11) at main.c(595) [Receiver=3.0.7]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(601)
+[sender=3.0.7]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The script fails to complete the new file with the new date on it. The 
workaround I have to get round this is to do the first backup after 
midnight with root manually, after that it works okay every three hours.

This worked without any problems under KDE, but its thrown up this problem on 
moving over to Gnome. Can anyone help me with a scripting solution please that 
will automate the whole process again for me?

Thanks
Sharon. 
-- 
A taste of linux = http://www.sharons.org.uk/taste/index.html
efever = http://www.efever.blogspot.com/
efever = http://sharon04.livejournal.com/
Debian 6,0.3, Gnome 1:2.30+7, LibreOffice 3.4.4
Registered Linux user 334501 
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list