From 4b8b17e788e4e0efa26db87b84b4e123941b1cff Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 9 May 2022 20:18:43 -0700 Subject: [PATCH] add update flag support to archivebox schedule --- archivebox/cli/archivebox_schedule.py | 6 ++++++ archivebox/main.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/archivebox/cli/archivebox_schedule.py b/archivebox/cli/archivebox_schedule.py index f528e6a6..d4747906 100644 --- a/archivebox/cli/archivebox_schedule.py +++ b/archivebox/cli/archivebox_schedule.py @@ -51,6 +51,11 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional action='store_true', help='Re-archive any URLs that have been previously archived, overwriting existing Snapshots', ) + parser.add_argument( + '--update', + action='store_true', + help='Re-pull any URLs that have been previously added, as needed to fill missing ArchiveResults', + ) group.add_argument( '--clear', # '-c' action='store_true', @@ -94,6 +99,7 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional every=command.every, depth=command.depth, overwrite=command.overwrite, + update=command.update, import_path=command.import_path, out_dir=pwd or OUTPUT_DIR, ) diff --git a/archivebox/main.py b/archivebox/main.py index b330d496..5f672656 100755 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -1128,6 +1128,7 @@ def schedule(add: bool=False, every: Optional[str]=None, depth: int=0, overwrite: bool=False, + update: bool=not ONLY_NEW, import_path: Optional[str]=None, out_dir: Path=OUTPUT_DIR): """Set ArchiveBox to regularly import URLs at specific times using cron""" @@ -1157,6 +1158,7 @@ def schedule(add: bool=False, *([ 'add', *(['--overwrite'] if overwrite else []), + *(['--update'] if update else []), f'--depth={depth}', f'"{import_path}"', ] if import_path else ['update']),