delete_items.pl - A batch item deletion tool, which generates a query against the items database and deletes the items matching the criteria specified in the command line arguments.
delete_items.pl [--help|--manual]
delete_items.pl [--verbose] --where "SQL CONDITIONAL EXPRESSION" ... [--commit]
Show the brief help information.
Read the manual, with examples.
Send the "WHERE" clause generated by the collected --where
arguments,
as well as items affected to Standard Out.
The --where
option may called multiple times.
The following argument must be a syntactically valid SQL statement which is part of the WHERE
clause querying the items table.
These are joined by AND
.
No items will be deleted unless the --commit
flag is present.
The following is an example of this script: delete_items.pl --where "items.withdrawn ! 0" --where "items.withdrawn_on < $(date --date="13 month ago" --rfc-3339=date)" --commit delete_items.pl --where "itemlost >= '1'" --where "itemlost <='4'" --where "itemlost_on < '2014-04-28'" --commit
This is a lightweight batch deletion tool for items, suitable for running in a cron job.
Barton Chittenden <barton@bywatersolutions.com>