mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-22 00:11:03 +01:00
Reduced container down time
This commit is contained in:
parent
5bb95d61f4
commit
d6b2b3c985
@ -65,9 +65,13 @@ for volume_name in volume_names:
|
|||||||
files_backup_dir_path=backup_dir_path + "/files"
|
files_backup_dir_path=backup_dir_path + "/files"
|
||||||
pathlib.Path(files_backup_dir_path).mkdir(parents=True, exist_ok=True)
|
pathlib.Path(files_backup_dir_path).mkdir(parents=True, exist_ok=True)
|
||||||
pathlib.Path(files_destination_path).mkdir(parents=True, exist_ok=True)
|
pathlib.Path(files_destination_path).mkdir(parents=True, exist_ok=True)
|
||||||
|
print("Backup data during container is running...")
|
||||||
|
rsync_command="rsync -abP --delete --delete-excluded --log-file=" + log_path +" --backup-dir=" + files_backup_dir_path +" '"+ source_path +"/' " + files_destination_path
|
||||||
|
print_bash(rsync_command)
|
||||||
print("stop containers...");
|
print("stop containers...");
|
||||||
|
print("Backup data after container is stopped...")
|
||||||
print_bash("docker stop " + list_to_string(containers))
|
print_bash("docker stop " + list_to_string(containers))
|
||||||
print_bash("rsync -abP --delete --delete-excluded --log-file=" + log_path +" --backup-dir=" + files_backup_dir_path +" '"+ source_path +"/' " + files_destination_path)
|
print_bash(rsync_command)
|
||||||
print("start containers...")
|
print("start containers...")
|
||||||
print_bash("docker start " + list_to_string(containers))
|
print_bash("docker start " + list_to_string(containers))
|
||||||
print("end backup routine for volume:" + volume_name)
|
print("end backup routine for volume:" + volume_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user