document_exporter target [-c] [-d] [-f] [-na] [-nt] [-p] [-sm] [-z]
optional arguments:
--c, --compare-checksums
--d, --delete
--f, --use-filename-format
+-c, --compare-checksums
+-d, --delete
+-f, --use-filename-format
-na, --no-archive
-nt, --no-thumbnail
--p, --use-folder-prefix
+-p, --use-folder-prefix
-sm, --split-manifest
--z --zip
+-z, --zip
+-zn, --zip-name
```
`target` is a folder to which the data gets written. This includes
documenttype, etc)
If `-z` or `--zip` is provided, the export will be a zip file
-in the target directory, named according to the current date.
+in the target directory, named according to the current local date or the
+value set in `-zn` or `--zip-name`.
!!! warning
help="Export the documents to a zip file in the given directory",
)
+ parser.add_argument(
+ "-zn",
+ "--zip-name",
+ default=f"export-{timezone.localdate().isoformat()}",
+ help="Sets the export zip file name",
+ )
+
parser.add_argument(
"--no-progress-bar",
default=False,
def handle(self, *args, **options):
self.target = Path(options["target"]).resolve()
- self.split_manifest = options["split_manifest"]
- self.compare_checksums = options["compare_checksums"]
- self.use_filename_format = options["use_filename_format"]
- self.use_folder_prefix = options["use_folder_prefix"]
- self.delete = options["delete"]
- self.no_archive = options["no_archive"]
- self.no_thumbnail = options["no_thumbnail"]
+ self.split_manifest: bool = options["split_manifest"]
+ self.compare_checksums: bool = options["compare_checksums"]
+ self.use_filename_format: bool = options["use_filename_format"]
+ self.use_folder_prefix: bool = options["use_folder_prefix"]
+ self.delete: bool = options["delete"]
+ self.no_archive: bool = options["no_archive"]
+ self.no_thumbnail: bool = options["no_thumbnail"]
zip_export: bool = options["zip"]
# If zipping, save the original target for later and
shutil.make_archive(
os.path.join(
original_target,
- f"export-{timezone.localdate().isoformat()}",
+ options["zip_name"],
),
format="zip",
root_dir=temp_dir.name,