Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a destination space check, it is set to off by default. If enab… #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

usernameallreadytaken
Copy link

@usernameallreadytaken usernameallreadytaken commented Dec 28, 2017

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.

…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
@greezybacon
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants