Added a destination space check, it is set to off by default. If enab…#70
Open
usernameallreadytaken wants to merge 1 commit intoku1ik:masterfrom
Open
Added a destination space check, it is set to off by default. If enab…#70usernameallreadytaken wants to merge 1 commit intoku1ik:masterfrom
usernameallreadytaken wants to merge 1 commit intoku1ik:masterfrom
Conversation
…led it checks to see more space is available than what is set in REMOTE_FREE_SPACE in the config before performing a sync. This is usefull on for example a rasberry pi that has a big external mounted filesystem (zfs or sshfs), in this case if one sets REMOTE_FREE_SPACE larger than the rasberry pis local filesystem (sd-card) one can sumise the external mount is available and will as such avoid writes to the mount point if the external mount is unavailable
Collaborator
|
I implemented a remote file system mount check in #67 which I think embodies the spirit and issue addressed in your pulll request. I've merged it into the develop branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a destination space check, it is set to off by default.
If enabled it checks that more space is available at the destination than what is set in REMOTE_FREE_SPACE (in the config) before performing a sync.
This is useful on for example a raspberry pi that has a big external mounted filesystem (zfs or sshfs), in this case if one can set REMOTE_FREE_SPACE larger than the raspberry pis local filesystem (sd-card) if the test passes one can surmise the external mount is available . This will avoids writes to the mounting point directory if the external mount is unavailable.
I fiddled a bit with reading /proc/mounts before I settled on this way of doing it. Reading /proc/mounts turned out to be more difficult than a simple size check on mounts that can have many similar roots such as ZFS. Also available free space is simple to reason around and solves my problem. (which is similar to #67 ).
But in this case this is harmless and extendable; one could overwrite the REMOTE_FREE_SPACE with something from a dry-run rsync and thereafter the check_free_space function checks that the process will not fail due to space issues. I found a dry-run takes a lot of time and it did not seem worth the performance cost for me; but if someone wants this in the future this is a building block towards that.