mirror of
				https://github.com/kevinveenbirkenbach/docker-volume-backup.git
				synced 2025-11-03 18:17:56 +00:00 
			
		
		
		
	Solved path bug and optimized readme.md
This commit is contained in:
		
							
								
								
									
										27
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								README.md
									
									
									
									
									
								
							@@ -9,18 +9,20 @@ It is part of the following scheme:
 | 
				
			|||||||

 | 
					
 | 
				
			||||||
Further information you will find [in this blog post](https://www.veen.world/2020/12/26/how-i-backup-dedicated-root-servers/).
 | 
					Further information you will find [in this blog post](https://www.veen.world/2020/12/26/how-i-backup-dedicated-root-servers/).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Backup
 | 
					## Backup all volumes
 | 
				
			||||||
Execute:
 | 
					Execute:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
./docker-volume-backup.sh
 | 
					./docker-volume-backup.sh
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Recover
 | 
					## Recover one volume
 | 
				
			||||||
Execute:
 | 
					Execute:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
./docker-volume-recover.sh {{volume_name}} {{backup_path}}
 | 
					
 | 
				
			||||||
 | 
					bash ./docker-volume-recover.sh "{{volume_name}}" "$(sha256sum /etc/machine-id | head -c 64)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Debug
 | 
					## Debug
 | 
				
			||||||
@@ -29,25 +31,6 @@ To checkout what's going on in the mount container type in the following command
 | 
				
			|||||||
```bash
 | 
					```bash
 | 
				
			||||||
docker run -it --entrypoint /bin/sh --rm --volumes-from {{container_name}} -v /Backups/:/Backups/ kevinveenbirkenbach/alpine-rsync
 | 
					docker run -it --entrypoint /bin/sh --rm --volumes-from {{container_name}} -v /Backups/:/Backups/ kevinveenbirkenbach/alpine-rsync
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
## Manual Backup
 | 
					 | 
				
			||||||
rsync -aPvv  '***{{source_path}}***/' ***{{destination_path}}***";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Test
 | 
					 | 
				
			||||||
Delete the volume.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```bash
 | 
					 | 
				
			||||||
docker rm -f container-name
 | 
					 | 
				
			||||||
docker volume rm volume-name
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Recover the volume:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```bash
 | 
					 | 
				
			||||||
docker volume create volume-name
 | 
					 | 
				
			||||||
docker run --rm -v volume-name:/recover/ -v ~/backup/:/backup/ "kevinveenbirkenbach/alpine-rsync" sh -c "rsync -avv /backup/ /recover/"
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Restart the container.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Optimation
 | 
					## Optimation
 | 
				
			||||||
This setup script is not optimized yet for performance. Please optimized this script for performance if you want to use it in a professional environment.
 | 
					This setup script is not optimized yet for performance. Please optimized this script for performance if you want to use it in a professional environment.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@
 | 
				
			|||||||
# @param $2 Hash-Name
 | 
					# @param $2 Hash-Name
 | 
				
			||||||
volume_name="$1"
 | 
					volume_name="$1"
 | 
				
			||||||
backup_hash="$2"
 | 
					backup_hash="$2"
 | 
				
			||||||
backup_path="/Backups/$backup_hash/docker-volume-backup/latest/$volume_name"
 | 
					backup_path="/Backups/$backup_hash/docker-volume-backup/latest/$volume_name/raw"
 | 
				
			||||||
echo "Inspect volume $volume_name"
 | 
					echo "Inspect volume $volume_name"
 | 
				
			||||||
docker volume inspect "$volume_name"
 | 
					docker volume inspect "$volume_name"
 | 
				
			||||||
exit_status_volume_inspect=$?
 | 
					exit_status_volume_inspect=$?
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user