mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-22 08:21:04 +01:00
Added routine to delete symlink if exists
This commit is contained in:
parent
03a8b56093
commit
bf817d8829
@ -52,6 +52,10 @@ version_dir = versions_dir + backup_time + "/"
|
|||||||
latest_link = backup_type_dir + "/latest/"
|
latest_link = backup_type_dir + "/latest/"
|
||||||
# Create folder to store version in
|
# Create folder to store version in
|
||||||
pathlib.Path(version_dir).mkdir(parents=True, exist_ok=True)
|
pathlib.Path(version_dir).mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
if pathlib.Path(latest_link).is_symlink():
|
||||||
|
print("Unlink " + latest_link + "...")
|
||||||
|
pathlib.Path(latest_link).unlink()
|
||||||
# Link latest to current version
|
# Link latest to current version
|
||||||
pathlib.Path(latest_link).symlink_to(version_dir)
|
pathlib.Path(latest_link).symlink_to(version_dir)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user