Page History
...
Code Block |
---|
# Perform a full site backup to AIPs(with user interaction disabled) every Sunday at 1:00AM # NOTE: Make sure to replace "123456789" with your actual Handle Prefix, and "admin@myu.edu" with your Administrator account email. 0 1 * * * [dspace]/bin/dspace packager -u -d -a -t AIP -e admin@myu.edu -i 123456789/0 [full-path-to-backup-folder]/sitewide-aip.zip |
Command Line Reference
The following flags are valid to pass to the [dspace]/bin/dspace packager
command:
Flag | Ingest or Export | Description / Usage |
---|---|---|
-a (--all) | both ingest and export | For Ingest: recursively ingest all child AIPs (referenced from this AIP). For Export: recursively export all child objects (referenced from this parent object) |
-d (--disseminate) | export-only | This flag simply triggers the export of AIPs from the system. See Exporting AIPs |
-e (–eperson) [email-address] | ingest-only | The email address of the EPerson who is ingesting the AIPs. Oftentimes this should be an Administrative account. |
-f (--force-replace) | ingest-only | Ingest the AIPs in "Force Replace Mode" (must be specified in conjunction with -r flag), where existing objects will be replaced by the contents of the AIP. |
-h (--help) | both ingest and export | Return help information. You should specify with -t for additional package specific help information |
-i (--identifier) [handle] | both ingest and export | For Ingest: Only valid in "Force Replace Mode". In that mode this is the identifier of the object to replace. For Export: The identifier of the object to export to an AIP |
-k (--keep-existing) | ingest-only | Specifies to use "Restore, Keep Existing Mode" during ingest (must be specified in conjunction with -r flag). In this mode, existing objects in DSpace will NOT be replaced by their AIPs, but missing objects will be restored from AIPs. |
-o (--option) [setting]=[value] | both ingest and export | This flag is used to pass Additional Packager Options to the Packager command. Each type of packager may define its own custom Additional Options. For AIPs, the valid options are documented in the Additional Packager Options section below. This is repeatable (e.g. -o [setting1]=[value] -o [setting2]=value ) |
-p (--parent) [handle] | ingest only | Handle(s) of the parent Community or Collection to into which an AIP should be ingested. This may be repeatable. |
-r (--restore) | ingest only | Specifies that this ingest is either "Restore Mode" (when standalone), "Restore, Keep Existing Mode" (when used with -k flag) or "Force Replace Mode" (when used with -f flag) |
-s (--submit) | ingest only | Specifies that this ingest is in "Submit Mode" where an AIP is treated as a new object and assigned a new Handle/Identifier, etc. |
-t (--type) [package-type] | both ingest and export | Specifies the type of package which is being ingested or exported. This controls which Ingester or Disseminator class is called. For AIPs, this is always set to "-t AIP " |
-u (--no-user-interaction) | both ingest and export | Skips over all user interaction (e.g. question prompts). This flag can be used when running the packager from a script or cron job to bypass all user interaction. |
Additional Packager Options
In additional to the various "modes" settings described under "Running the Code" above, the AIP Packager supports the following packager options. These options allow you to better tweak how your AIPs are processed (especially during ingests/restores/replaces).
Option | Ingest or Export | Default Value | Description |
---|---|---|---|
| ingest-only | true | Tells the AIP ingester to automatically create any metadata fields which are found to be missing from the DSpace Metadata Registry. When 'true', this means as each AIP is ingested, new fields may be added to the DSpace Metadata Registry if they don't already exist. When 'false', an AIP ingest will fail if it encounters a metadata field that doesn't exist in the DSpace Metadata Registry. (NOTE: This will not create missing DSpace Metadata Schemas. If a schema is found to be missing, the ingest will always fail.) |
| export-only | defaults to exporting all Bundles | This option can be used to limit the Bundles which are exported to AIPs for each DSpace Item. By default, all file Bundles will be exported into Item AIPs. You could use this option to limit the size of AIPs by only exporting certain Bundles. WARNING: any bundles not included in AIPs will obviously be unable to be restored. This option can be run in two ways:
|
| ingest-only | Restore/Replace Mode defaults to 'false', | If 'true', the AIP ingester will ignore any Handle specified in the AIP itself, and instead create a new Handle during the ingest process (this is the default when running in Submit mode, using the |
| ingest-only | Restore/Replace Mode defaults to 'false', | If 'true', the AIP ingester will ignore any Parent object specified in the AIP itself, and instead ingest under a new Parent object (this is the default when running in Submit mode, using the |
| export-only | defaults to "all" | This option can be used to limit the Bundles which are exported to AIPs for each DSpace Item. By default, all file Bundles will be exported into Item AIPs. You could use this option to limit the size of AIPs by only exporting certain Bundles. WARNING: any bundles not included in AIPs will obviously be unable to be restored. This option expects a comma separated list of bundle names (e.g. "ORIGINAL,LICENSE,CC_LICENSE,METADATA"), or "all" if all bundles should be included. |
| both import ingest and export | false | If 'true', the AIP Disseminator will only import/export a METS Manifest XML file (i.e. result will be an unzipped 'mets.xml' file), instead of a full AIP. This METS Manifest contains URI references to all content files, but does not contain any content files. This option is experimental and is meant for debugging purposes only. It should never be set to 'true' if you want to be able to restore content files. Again, please note that when you use this option, the final result will be an XML file, NOT the normal ZIP-based AIP format. |
| export-only | false | If 'true' (and the 'DSPACE-ROLES' crosswalk is enabled, see #AIP Metadata Dissemination Configurations), then the AIP Disseminator will export user password hashes (i.e. encrypted passwords) into Site AIP's METS Manifest. This would allow you to restore user's passwords from Site AIP. If 'false', then user password hashes are not stored in Site AIP, and passwords cannot be restored at a later time. |
| importingest-only | false | If 'true', ingestion will skip over any "Could not find a parent DSpaceObject" errors that are encountered during the ingestion process (Note: those errors will still be logged as "warning" messages in your DSpace log file). If you are performing a full site restore (or a restore of a larger Community/Collection hierarchy), you may encounter these errors if you have a larger number of Item mappings between Collections (i.e. Items which are mapped into several collections at once). When you are performing a recursive ingest, skipping these errors should not cause any problems. Once the missing parent object is ingested it will automatically restore the Item mapping that caused the error. For more information on this "Could not find a parent DSpaceObject" error see Common Issues or Error Messages. |
| export-only | unspecified | If 'skip', the AIP Disseminator will skip over any unauthorized Bundle or Bitstream encountered (i.e. it will not be added to the AIP). If 'zero', the AIP Disseminator will add a Zero-length "placeholder" file to the AIP when it encounters an unauthorized Bitstream. If unspecified (the default value), the AIP Disseminator will throw an error if an unauthorized Bundle or Bitstream is encountered. |
| export-only | unspecified | This option works as a basic form of "incremental backup". This option requires that an ISO-8601 date is specified. When specified, the AIP Disseminator will only export Item AIPs which have a last-modified date after the specified ISO-8601 date. This option has no affect on the export of Site, Community or Collection AIPs as DSpace does not record a last-modified date for Sites, Communities or Collections. For example, when this option is specified during a full-site export, the AIP Disseminator will export the Site AIP, all Community AIPs, all Collection AIPs, and only Item AIPs modified after that date and time. |
| both import ingest and export | Export defaults to 'true', | If 'true', every METS file in AIP will be validated before ingesting or exporting. By default, DSpace will validate everything on export, but will skip validation during import. Validation on export will ensure that all exported AIPs properly conform to the METS profile (and will throw errors if any do not). Validation on import will ensure every METS file in every AIP is first validated before importing into DSpace (this will cause the ingestion processing to take longer, but tips on speeding it up can be found in the "AIP Configurations To Improve Ingestion Speed while Validating" section below). DSpace recommends minimally validating AIPs on export. Ideally, you should validate both on export and import, but import validation is disabled by default in order to increase the speed of AIP restores. |
How to use
...
additional options
These options can be passed in two main ways:
...