Rsync Docker Container useful for named volume copy and backup.
399
Rsync Docker Container useful for named volume backup and restore.
Using rsync to copy container named volume data, very useful to make volume backups, this could be achieved using cp from inside a container or even docker cp, but I decided by rsync for some reasons:
I taked from this useful post: http://blog.diovani.com/technology/2017/06/24/moving-docker-containers-data.html from this repo too: https://github.com/loomchild/volume-backup and I did a merge in one solution, creating a simple backup and restore docker container using rsync.
Download this repo and build using this command:
docker build --rm=true --no-cache=true --force-rm=true -t your_image_name:tag .
docker run -v [volume_name]:/volume -v [output_dir]:/backup --rm onedsol/rsync:2.0 backup
docker run -v [volume_name]:/volume -v [source_dir]:/backup --rm onedsol/rsync:2.0 restore
Very important note, take care of output and source paths because this script delete all data in restore process and overwrite data in backup process.
Content type
Image
Digest
Size
2.2 MB
Last updated
over 8 years ago
docker pull onedsol/rsync