create restorePath if it does not exist
This commit is contained in:
		
							parent
							
								
									cfd7d6ede0
								
							
						
					
					
						commit
						7cc69a616a
					
				
							
								
								
									
										6
									
								
								.vscode/numbered-bookmarks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.vscode/numbered-bookmarks.json
									
									
									
									
										vendored
									
									
								
							| @ -4,15 +4,15 @@ | |||||||
| 			"fsPath": "$ROOTPATH$/borghelper.sh", | 			"fsPath": "$ROOTPATH$/borghelper.sh", | ||||||
| 			"bookmarks": [ | 			"bookmarks": [ | ||||||
| 				-1, | 				-1, | ||||||
| 				215, | 				268, | ||||||
| 				232, | 				10, | ||||||
| 				-1, | 				-1, | ||||||
| 				-1, | 				-1, | ||||||
| 				-1, | 				-1, | ||||||
| 				-1, | 				-1, | ||||||
| 				-1, | 				-1, | ||||||
| 				-1, | 				-1, | ||||||
| 				169 | 				384 | ||||||
| 			] | 			] | ||||||
| 		} | 		} | ||||||
| 	] | 	] | ||||||
|  | |||||||
| @ -266,6 +266,21 @@ fi | |||||||
| if [ "$commonOptions" ]; then commonOptions=${commonOptions##[[:space:]]}; fi | if [ "$commonOptions" ]; then commonOptions=${commonOptions##[[:space:]]}; fi | ||||||
| if [ "$restoreOptions" ]; then restoreOptions=${restoreOptions##[[:space:]]}; fi | if [ "$restoreOptions" ]; then restoreOptions=${restoreOptions##[[:space:]]}; fi | ||||||
| 
 | 
 | ||||||
|  | # check/create restore path | ||||||
|  | if [ -d "$restorePath" ]; then | ||||||
|  |     if ! touch "${restorePath}/touch.test" > /dev/null 2>&1; then | ||||||
|  |         consoleError 5 'Cannot write to specified restore directory.' | ||||||
|  |     fi | ||||||
|  | else | ||||||
|  |     if ! mkdir -p "${restorePath}" > /dev/null 2>&1; then | ||||||
|  |         consoleError 5 'Cannot create specified restore directory.' | ||||||
|  |     else | ||||||
|  |         if ! touch "${restorePath}/touch.test" > /dev/null 2>&1; then | ||||||
|  |         consoleError 5 'Cannot write to specified restore directory.' | ||||||
|  |         fi | ||||||
|  |     fi | ||||||
|  | fi | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| ### read borg information file | ### read borg information file | ||||||
| 
 | 
 | ||||||
| @ -372,6 +387,7 @@ exit 0 | |||||||
| # 1:    parameter error (missing, non-existant or invalid input) | # 1:    parameter error (missing, non-existant or invalid input) | ||||||
| # 2:    parameter missing/invalid in .borgvars file | # 2:    parameter missing/invalid in .borgvars file | ||||||
| # 3:    could not create/remove borg tmp directory | # 3:    could not create/remove borg tmp directory | ||||||
|  | # 4:    could not write sample borgvars file (permissions?) | ||||||
|  | # 5:    cannot create/write to restore path or could not remove touch.test file | ||||||
| 
 | 
 | ||||||
| #EOF# 4:    could not write sample borgvars file (permissions?) | #EOF | ||||||
| # 5:    cannot create/write to restore path |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user