mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-04 04:08:15 +00:00 
			
		
		
		
	added paths for ssd and hdd as parameter
This commit is contained in:
		@@ -45,9 +45,18 @@ def pause_and_move(storage_path,volume):
 | 
			
		||||
    
 | 
			
		||||
    start_containers(containers)
 | 
			
		||||
 | 
			
		||||
# Path on the SSD where data will be moved
 | 
			
		||||
ssd_path = "/path/to/ssd"
 | 
			
		||||
hdd_path = "/path/to/hdd"
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    # Argument parser setup
 | 
			
		||||
    parser = argparse.ArgumentParser(description='Migrate Docker volumes to SSD or HDD based on container image.')
 | 
			
		||||
    parser.add_argument('--ssd_path', type=str, required=True, help='Path to the SSD storage')
 | 
			
		||||
    parser.add_argument('--hdd_path', type=str, required=True, help='Path to the HDD storage')
 | 
			
		||||
    
 | 
			
		||||
    # Parse arguments
 | 
			
		||||
    args = parser.parse_args()
 | 
			
		||||
 | 
			
		||||
    # Set paths from arguments
 | 
			
		||||
    ssd_path = args.ssd_path
 | 
			
		||||
    hdd_path = args.hdd_path
 | 
			
		||||
 | 
			
		||||
    # List all Docker volumes
 | 
			
		||||
    volumes = run_command("docker volume ls -q").splitlines()
 | 
			
		||||
@@ -72,3 +81,4 @@ for volume in volumes:
 | 
			
		||||
                pause_and_move(hdd_path,volume)
 | 
			
		||||
    
 | 
			
		||||
    print("Operation completed.")
 | 
			
		||||
    
 | 
			
		||||
		Reference in New Issue
	
	Block a user