Manage your named docker volumes using this simple script.
### Managing docker-volumes with a simple script.
-----
### Usage:
1. Clone this repository:
`git clone https://github.com/ansrivas/docker-volume-manager.git`
2. Go to the directory and install this locally:
`cd docker-volume-manager && pip install -e .`
3. To save a named-docker-volume:
`docker-volume-manager save --volume <existing_named_volume>`
4. To load an already saved local volume to a named-docker-volume:
`docker-volume-manager load --volume <new_volume_name> --path <absolute_path_to_your_saved_volume>`
5. More options can be seen by using the help:
`docker-volume-manager --help`
6. A simple use case could be to backup files:
```bash
# cat backup_script.py
import os
import subprocess
import time
files = os.listdir('./')
tars = [f for f in files if f.endswith('.tar.gz')]
to_keep = sorted(tars)[-7:]
for tar in tars:
if tar not in to_keep:
os.remove(tar)
command = ["/usr/bin/docker-volume-manager", "save", "--volume", "your_docker_data_volume", "--interactive","False"]
subprocess.check_output(command )
```
###### Disclaimer: Do not use it directly in a production environment. Test it locally before using it out there.
Metadata
Release files for docker-volume-manager 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docker-volume-manager-1.0.2.tar.gz | 4.1 kB | Without provenance | Details for docker-volume-manager-1.0.2.tar.gz |
Release files / docker-volume-manager-1.0.2.tar.gz
| Download URL | docker-volume-manager-1.0.2.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aec52eb61c369ebbed6e478eb8f02cdfa9766e7032989475c42b3a9187e2ee10
|
|
BLAKE2b-256 checksum How to use checksums |
469d44cc14d13563c66604fb0ac7c3bfd43b39eade9a070452ff75c60e7761c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for docker-volume-manager 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.