You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -199,6 +200,37 @@ You may need to set up multiple automated transfer instances, for example if req
199
200
200
201
In case different hooks are required for each instance, a possible approach is to checkout a new instance of the automation tools, for example in `/usr/lib/archivematica/automation-tools-2`
201
202
203
+
204
+
Automated package moving
205
+
------------------------
206
+
207
+
`storage/move_packages.py` is a helper script used to automate moving packages between locations.
208
+
209
+
The script takes the UUID of a `<move_from>` Location, and the UUID of a `<move_to>` Location.
210
+
211
+
When executed, the script will:
212
+
213
+
* query the storage service and ask for a list of packages in the move_from Location.
214
+
* check if the first package returned is in the automation tools db.
215
+
* If it is not there, the script will call the move_package endpoint with this packages’s UUID and the UUID of the move_to Location, then exit.
216
+
* The next time the script is executed, it will query the status of the package.
217
+
* If it is ‘moving’, the script will go back to sleep.
218
+
* Once the status of the current package is no longer ‘moving’, the script will go on to the next package.
219
+
220
+
The script makes use of the `move` endpoint in the Storage Service REST API.
221
+
The `move` endpoint takes two arguments: UUID of an existing package (AIP or DIP or transfer) and the UUID of a Location.
222
+
223
+
The move_package endpoint will:
224
+
* Confirm that the type of package (AIP or DIP or Transfer) matches the new Location
225
+
* Set the status of the package to ‘moving’
226
+
* Copy the package from its current location to the new location using rsync and leave the original copy of the package alone
227
+
* Execute any post store hooks configured for the Location (for example, call the Arkivum finalize command)
228
+
* Update the internal storage service database with the new location of the package (and new status, set by the Space)
229
+
* If the rsync command does not work or there is a failure in post store commands, the status of the package will be set to ‘move failed’, and the internal ss database will not be updated
230
+
231
+
The `etc` directory contains an example script (`storage-script.sh`) and config file (`storage.conf`)
0 commit comments