The Samba-Bugzilla – Bug 10540
--max-transfer and --create-freespace options for working with limited space
Last modified: 2014-04-04 21:42:49 UTC
In order to use options such as --delay-updates etc. it is necessary to ensure a target file-system has plenty of free space, with rsync unable to do anything if space runs out, other than to throw error after error. This usually necessitates either enough capacity that this should never happen, multi-stage transfers, or pre-flight scripts to guess required space and make sure that much is free.
What I'd like to propose are two options to give rsync the ability to manage its requirement for free-space itself, these would be:
--max-transfer, this option sets a limit on how much data rsync will transfer, once this limit is reached rsync will stop with a soft-error. Use of a partial-dir is recommended as it allows an incomplete file to be picked up, while files that did complete within the transfer size window will be moved into placed as normal.
--create-freespace, this option, when set, tells rsync that it can attempt to free up space if it runs out. To do-so, it will first perform any pending deletions (e.g - from --delete-during), before moving delayed updates into position. If this still leaves it with insufficient free-space then it throw an error and stop.