<<

NAME

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.

SYNOPSIS

delete_items.pl [--help|--manual]

delete_items.pl [--verbose] --where "SQL CONDITIONAL EXPRESSION" ... [--commit]

OPTIONS

--help

Show the brief help information.

--manual

Read the manual, with examples.

--verbose

Send the "WHERE" clause generated by the collected --where arguments, as well as items affected to Standard Out.

--where

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.

--commit

No items will be deleted unless the --commit flag is present.

EXAMPLES

  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

DESCRIPTION

 This is a lightweight batch deletion tool for items, suitable for running in a cron job.

AUTHOR

 Barton Chittenden <barton@bywatersolutions.com>

<<