diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 90484dc9..a604a720 100755 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -637,6 +637,7 @@ def run_argparse( ap2.add_argument("--hardlink", action="store_true", help="prefer hardlinks instead of symlinks when possible (within same filesystem)") ap2.add_argument("--never-symlink", action="store_true", help="do not fallback to symlinks when a hardlink cannot be made") ap2.add_argument("--no-dedup", action="store_true", help="disable symlink/hardlink creation; copy file contents instead") + ap2.add_argument("--no-snap", action="store_true", help="disable snapshots -- forget unfinished uploads on shutdown; don't create .hist/up2k.snap files -- abandoned/interrupted uploads must be cleaned up manually") ap2.add_argument("--magic", action="store_true", help="enable filetype detection on nameless uploads") ap2.add_argument("--df", metavar="GiB", type=float, default=0, help="ensure GiB free disk space by rejecting upload requests") ap2.add_argument("--sparse", metavar="MiB", type=int, default=4, help="windows-only: minimum size of incoming uploads through up2k before they are made into sparse files") diff --git a/copyparty/up2k.py b/copyparty/up2k.py index ba9068b8..c3e1e4a0 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -3025,7 +3025,7 @@ class Up2k(object): except: pass - if self.args.nw: + if self.args.nw or self.args.no_snap: return path = os.path.join(histpath, "up2k.snap") @@ -3157,8 +3157,9 @@ class Up2k(object): for x in list(self.spools): self._unspool(x) - self.log("writing snapshot") - self.do_snapshot() + if not self.args.no_snap: + self.log("writing snapshot") + self.do_snapshot() def up2k_chunksize(filesize: int) -> int: