<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head><meta http-equiv="Content-Type" content="text/html;charset=us-ascii">
<style>BODY{font:10pt Tahoma, Verdana, sans-serif}</style></head><body>
Hello,<div><br></div><div>I have a couple of questions about using rsync scriptographically. I've looked around and can't find anything. I must be missing something obvious.</div><div><br></div><div>I'm trying to write a script that will synchronise various local folders on a Mac OS X Workstation to an SMB mounted Windows (2003, mostly) Server where the user I'm copying as has a quota applied. I want to compare the available space I have, which I can find with:</div><div><br></div><div>df /Volumes/$USER | grep % | awk -F'[ ] ' '{ print $4 }'</div><div><br></div><div>Against the amount of data that rsync thinks it is going to copy.</div><div><br></div><div>What I'm after is the most efficient way of finding out how much data rsync wants to copy, dying (relatively) gracefully should it be within X of the quota (say, 10MB or so).</div><div><br></div><div>At the moment I can use the same rsync command I'd run to do the copy but with the -n option:</div><div><br></div><div>rsync -a -u -z -E -r -l -n --progress /path/to/src /Volumes/path/to/dest/ | grep "total size is" | awk -F'[ ]' '{ print $4 }'</div><div><br></div><div>to do a dry-run to grep and cut a number from rsync's output.</div><div><br></div><div>The only thing is that this might take a while if there are very many files and potentially there are hundreds of thousands. I'd then have to go and run the same command all over again should the data fit, this time without the -n option. I also feel that my units may be rather disparate (i.e. df's output isn't the same unit sizes as rsync's).</div><div><br></div><div>I'm sure there must be a better way than running rsync twice.</div><div><br></div><div>On another note I'm getting an error:</div><div><br></div><div>copyfile(.._..v6AxMh,./., COPYFILE_UNPACK) failed:13</div><div><br></div><div>When trying to run with -E. The consensus seems to be that it's a permissions issue (which I'll investigate later). Thoughts?</div><div><br></div><div>Many thanks,</div><div>~W</div><BR />
<BR />
<HR />
***IMPORTANT&nbsp;NOTE***<BR />
As&nbsp;of&nbsp;the&nbsp;1st&nbsp;March&nbsp;2010&nbsp;we&nbsp;have&nbsp;incorporated&nbsp;our&nbsp;Mac&nbsp;Support&nbsp;Services&nbsp;within&nbsp;Amsys&nbsp;PLC.<BR />
<BR />
Amsys&nbsp;PLC.<BR />
Byron&nbsp;House,<BR />
Lower&nbsp;Road,<BR />
Kenley,<BR />
Surrey,<BR />
CR8&nbsp;5NB<BR />
<BR />
(T)&nbsp;&nbsp;+44&nbsp;(0)20&nbsp;8660&nbsp;7750<BR />
(F)&nbsp;&nbsp;+44&nbsp;(0)20&nbsp;8763&nbsp;0924<BR />
(W)&nbsp;www.amsys.co.uk<BR />
(E)&nbsp;info@macolytes.co.uk<BR />
<BR />
-&nbsp;Apple&nbsp;Authorised&nbsp;Service&nbsp;Provider&nbsp;(AASP)&nbsp;-<BR />
<BR />
DISCLAIMER&nbsp;NOTICE<BR />
The&nbsp;information&nbsp;contained&nbsp;within&nbsp;this&nbsp;e-mail&nbsp;is&nbsp;confidential&nbsp;and&nbsp;is&nbsp;intended&nbsp;solely&nbsp;for&nbsp;the&nbsp;addressee.&nbsp;<BR />
Access&nbsp;to&nbsp;this&nbsp;e-mail&nbsp;by&nbsp;any&nbsp;other&nbsp;party&nbsp;is&nbsp;unauthorised.&nbsp;Any&nbsp;views&nbsp;or&nbsp;opinions&nbsp;presented&nbsp;are&nbsp;solely&nbsp;<BR />
those&nbsp;of&nbsp;the&nbsp;author&nbsp;and&nbsp;do&nbsp;not&nbsp;necessarily&nbsp;represent&nbsp;those&nbsp;of&nbsp;Amsys&nbsp;PLC.&nbsp;Internet&nbsp;<BR />
communications&nbsp;are&nbsp;not&nbsp;secure&nbsp;and&nbsp;Amsys&nbsp;PLC.&nbsp;does&nbsp;not&nbsp;accept&nbsp;any&nbsp;responsibility&nbsp;<BR />
for&nbsp;the&nbsp;contents&nbsp;of&nbsp;this&nbsp;message&nbsp;or&nbsp;changes&nbsp;made&nbsp;to&nbsp;this&nbsp;message&nbsp;after&nbsp;it&nbsp;was&nbsp;sent.<BR />
<BR />
Please&nbsp;consider&nbsp;the&nbsp;environment&nbsp;before&nbsp;printing&nbsp;this&nbsp;e-mail<BR />
</body></html>