script aborts if no qcow2-File found
This commit is contained in:
		
							parent
							
								
									3768d0e77b
								
							
						
					
					
						commit
						d7d0069dd3
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -67,7 +67,7 @@ sync_all_images() { | ||||||
| 
 | 
 | ||||||
| delete_old_qcows() { | delete_old_qcows() { | ||||||
|     cd /lmn/vm |     cd /lmn/vm | ||||||
|     for qcow2 in *.qcow2; do |     for qcow2 in $(find . -maxdepth 1 -name "*.qcow2" -exec basename {} ';'); do | ||||||
| 	qcowsize=$(stat -c%s "${qcow2}") | 	qcowsize=$(stat -c%s "${qcow2}") | ||||||
| 	if [[ -f "${qcow2}.size" ]] && [[ "${qcowsize}" != $(<"${qcow2}.size") ]]; then | 	if [[ -f "${qcow2}.size" ]] && [[ "${qcowsize}" != $(<"${qcow2}.size") ]]; then | ||||||
|             torrent="${qcow2}.torrent" |             torrent="${qcow2}.torrent" | ||||||
|  | @ -77,7 +77,7 @@ delete_old_qcows() { | ||||||
|             fi |             fi | ||||||
| 	    rm "${qcow2}" | 	    rm "${qcow2}" | ||||||
| 	fi | 	fi | ||||||
|     done  |     done | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| sync_all_torrents() { | sync_all_torrents() { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Raphael Dannecker
						Raphael Dannecker