Skip to content

Instantly share code, notes, and snippets.

@lawlesst
Created July 16, 2012 12:35
Show Gist options
  • Save lawlesst/3122445 to your computer and use it in GitHub Desktop.
Save lawlesst/3122445 to your computer and use it in GitHub Desktop.
Cleans the search history table in Vufind.
#!/bin/sh
#removes expired searches in Vufind search history table
EXPIRE_DATE=`date --date="-2 day" +%Y-%m-%d`
echo "Vufind - deleting expired search sessions from $EXPIRE_DATE."
mysql -u $1 --password=$2 -e "delete from search where (saved=0 AND created<=\"${EXPIRE_DATE}\")" vufind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment