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

Update to allow script to manage docker containers on multiple remote hosts #24

Merged
merged 12 commits into from
Dec 2, 2021

Conversation

tehniemer
Copy link
Contributor

I made some updates to the way remote hosts are handled to allow management across multiple IP addresses. I had to change a few things in the way IFS was used in the config file to allow this to work. This is working to pause containers on three machines I have docker services on.

Added variables to allow script to pause containers that could modify files during diff/sync/scrub
Added code to pause docker containers that could modify files during diff/sync/scrub, either locally or on a remote machine.
Changed "unpause" to "resume"
Pause/Unpause was throwing errors, changed to Stop/Start.
Changed where and how `stop_services` is called.

`get_counts` was failing, modified order and added counts to match `snapraid diff` output
Updated script to be able to pause/stop docker containers on multiple remote hosts. This would probably also work for local docker instances as well.
@auanasgheps
Copy link
Owner

Hello! Thanks for this contribution. I don't have the time to review it now, but I want to ensure it doesn't affect other functionalities, especially the IFS condition.

@auanasgheps
Copy link
Owner

auanasgheps commented Dec 1, 2021

Hi @tehniemer, I've done some testing and everything looks good, so the IFS modifications haven't impacted other areas of the script.

The only thing I don't like is that standard containers are separated by a space, instead remote containers use comma without spaces.

Do you think you can adjust the remote containers to use space?

@tehniemer
Copy link
Contributor Author

tehniemer commented Dec 2, 2021

I did try that at first, but couldn't get it to work. Bash can't handle multidimensional arrays and this was the only way I could figure out how to approximate one given my limited scripting knowledge. I can take another look, but it may take some time.

@auanasgheps
Copy link
Owner

I did try that at first, but couldn't get it to work. Bash can't handle multidimensional arrays and this was the only way I could figure out how to approximate one given my limited scripting knowledge. I can take another look, but it may take some time.

My scripting capabilities are limited too, so don't worry.
I'll merge and make some adjustments to the comments to make the requirements clear.

I'll ask some friends who know bash, but if you eventually figure it it out you can always make another PR.

@auanasgheps auanasgheps merged commit ef20123 into auanasgheps:master Dec 2, 2021
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.

None yet

2 participants