Rsync on Mac OS X
Michael Reynolds
neufurth_bernd at yahoo.com
Tue Aug 14 16:56:02 GMT 2007
Hello,
I am using rsync at Mac OS X for synchronizing
pictures for our two offices. Unfortunatelly yesterday
the script stops working. Here is little workarround.
The script select every file from folder A and write
it to PENDING-FILES file. Than RSYNC take from
PENDING-FILES every line (file) and transfer to folder
B on different machine. Unfortunately some Mac user
created folder started with "Bullet" symbol
(http://en.wikipedia.org/wiki/%E2%80%A2) (e.g.
<bullet><space>New<space>Pictures) and the script
stops and nothing is transfered. Is something wrong
with script or RSYNC ? (see bellow complete script).
Thanks for help in advance.
Jason
#!/bin/bash -x
in="/Volumes/Pictures/Photos"
out="user at xxx.xxx.xxx.xxx:/Volumes/Pictures/Photos/"
echo "script called $0 $1 $2"
cd "$in"
for i in *
do
if [ $(lsof | grep -c "$i") = "0" ];
then
echo -n "-- Parsing $i"
if [ ! -s .pending_files ];
then
echo "Pending:" > .pending_files
fi;
if [ $(grep -c "$i" .pending_files) = "0" ];
then
echo "$i" >> .pending_files
echo "sending $i"
rsync -vctzER -e ssh --timeout=600 --progress
"$i" "$out"
if [ "$?" = "0" ];
then
echo "$i" >> .sent_files
else
echo -n "-- File $i transfer failed" | logger
grep -v "$i" .pending_files >
.pending_files_new
mv .pending_files_new .pending_files
fi;
fi;
else
echo -n "-- File $i is in use" | logger
fi;
done
exit 0
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469
More information about the rsync
mailing list