diff --git a/src/borg/archiver/create_cmd.py b/src/borg/archiver/create_cmd.py index 5b0547ca0..d87c1bd1e 100644 --- a/src/borg/archiver/create_cmd.py +++ b/src/borg/archiver/create_cmd.py @@ -225,6 +225,7 @@ class CreateMixIn: progress=args.progress, lock_wait=self.lock_wait, permit_adhoc_cache=args.no_cache_sync, + force_adhoc_cache=args.no_cache_sync_forced, cache_mode=args.files_cache_mode, iec=args.iec, ) as cache: @@ -803,6 +804,12 @@ class CreateMixIn: action="store_true", help="experimental: do not synchronize the cache. Implies not using the files cache.", ) + subparser.add_argument( + "--no-cache-sync-forced", + dest="no_cache_sync_forced", + action="store_true", + help="experimental: do not synchronize the cache (forced). Implies not using the files cache.", + ) subparser.add_argument( "--stdin-name", metavar="NAME", diff --git a/src/borg/cache.py b/src/borg/cache.py index 831a46ee0..3338c111b 100644 --- a/src/borg/cache.py +++ b/src/borg/cache.py @@ -413,6 +413,7 @@ class Cache: progress=False, lock_wait=None, permit_adhoc_cache=False, + force_adhoc_cache=False, cache_mode=FILES_CACHE_MODE_DISABLED, iec=False, ): @@ -431,6 +432,9 @@ class Cache: def adhoc(): return AdHocCache(manifest=manifest, lock_wait=lock_wait, iec=iec) + if force_adhoc_cache: + return adhoc() + if not permit_adhoc_cache: return local()