[Koha-bugs] [Bug 14504] Add command-line script to batch delete items based on lost/withdrawn statuses
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Jul 7 21:18:59 CEST 2015
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14504
--- Comment #1 from Barton Chittenden <barton at bywatersolutions.com> ---
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|--version]
delete_items.pl [--verbose] [--dry-run] --criteria "*SQL CONDITIONAL
EXPRESSION*" ... [--commit]
OPTIONS
--help Show the brief help information.
--manual
Read the manual, with examples.
--version
Show the version number and exit.
--verbose
Send the "WHERE" clause generated by the collected "--criteria"
arguments, as well as items affected to Standard Out.
--criteria
The "--criteria" 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.
--dry-run
Disables "--commit" flag and enables "--verbose" flag.
EXAMPLES
The following is an example of this script:
delete_items.pl --criteria "items.withdrawn ! 0" --criteria
"items.withdrawn_on < $(date --date="13 month ago" --rfc-3339=date)" --commit
delete_items.pl --criteria "itemlost >= '1'" --criteria "itemlost <='4'"
--criteria "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 at bywatersolutions.com>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list