mirror of
				https://github.com/kevinveenbirkenbach/docker-volume-backup.git
				synced 2025-11-03 18:17:56 +00:00 
			
		
		
		
	Added routine to delete symlink if exists
This commit is contained in:
		@@ -52,6 +52,10 @@ version_dir = versions_dir + backup_time + "/"
 | 
			
		||||
latest_link = backup_type_dir + "/latest/"
 | 
			
		||||
# Create folder to store version in
 | 
			
		||||
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
 | 
			
		||||
pathlib.Path(latest_link).symlink_to(version_dir)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user