| 
					
				 | 
			
			
				@@ -1184,6 +1184,7 @@ class Archiver: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     def _delete_repository(self, args, repository): 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         """Delete a repository""" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         dry_run = args.dry_run 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        keep_security_info = args.keep_security_info 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if not args.cache_only: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             msg = [] 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1208,9 +1209,11 @@ class Archiver: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if not dry_run: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 repository.destroy() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 logger.info("Repository deleted.") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                SecurityManager.destroy(repository) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if not keep_security_info: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    SecurityManager.destroy(repository) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             else: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 logger.info("Would delete repository.") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                logger.info("Would %s security info." % ("keep" if keep_security_info else "delete")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if not dry_run: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Cache.destroy(repository) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             logger.info("Cache deleted.") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3360,9 +3363,10 @@ class Archiver: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Important: When deleting archives, repository disk space is **not** freed until 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         you run ``borg compact``. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        If you delete the complete repository, the local cache for it (if any) is 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        also deleted. Alternatively, you can delete just the local cache with the 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ``--cache-only`` option. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        When you delete a complete repository, the security info and local cache for it 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (if any) are also deleted. Alternatively, you can delete just the local cache 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        with the ``--cache-only`` option, or keep the security info with the 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ``--keep-security-info`` option. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         When using ``--stats``, you will get some statistics about how much data was 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         deleted - the "Deleted data" deduplicated size there is most interesting as 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -3391,10 +3395,11 @@ class Archiver: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                help='print statistics for the deleted archive') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         subparser.add_argument('--cache-only', dest='cache_only', action='store_true', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                help='delete only the local cache for the given repository') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        subparser.add_argument('--force', dest='forced', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                               action='count', default=0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        subparser.add_argument('--force', dest='forced', action='count', default=0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                help='force deletion of corrupted archives, ' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     'use ``--force --force`` in case ``--force`` does not work.') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        subparser.add_argument('--keep-security-info', dest='keep_security_info', action='store_true', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                               help='keep the local security info when deleting a repository') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         subparser.add_argument('--save-space', dest='save_space', action='store_true', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                help='work slower, but using less space') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         subparser.add_argument('location', metavar='REPOSITORY_OR_ARCHIVE', nargs='?', default='', 
			 |