Skip to content

Instantly share code, notes, and snippets.

@macbre
Created June 28, 2018 08:19
Show Gist options
  • Save macbre/8645f1f1a0563f9cfac2bee28ce35fb3 to your computer and use it in GitHub Desktop.
Save macbre/8645f1f1a0563f9cfac2bee28ce35fb3 to your computer and use it in GitHub Desktop.
SUS-4813
#!/bin/bash
WIKI=$1
DB_PARAMS=`dbparams.pl --name $WIKI --type slave`
echo "Removing broken comments redirects on ${WIKI} ..."
mysql $DB_PARAMS -e "select /* SUS-4813 */ page_id from querycache, page where qc_type = 'BrokenRedirects' and qc_title LIKE '%/@comment%' and page_title = qc_title and page_namespace = qc_namespace;" --skip-column-names --batch | tee /tmp/SUS-4813.pages
run_maintenance --db $WIKI --script="deleteBatch.php -u FANDOMbot -r SUS-4813 --by-id --listfile /tmp/SUS-4813.pages"
run_maintenance --db $WIKI --script='updateSpecialPages.php --only=BrokenRedirects'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment