Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This is a script to identify pages with identical (but differently cased) names in the main namespace
- # It's intended to be used before changing the mediawiki namespace to a case-insensitive collation
- #
- # Usage : ./find_wiki_dups.sh <database name> <namespace id> <URL path to wiki pages>
- DBNAME=$1
- NAMESPACE=$2
- URL=$3
- #!/bin/bash
- for page in `mysql $DBNAME -s -N -e "select page_title from mediawiki_page where page_namespace=$NAMESPACE group by lower(page_title) having count(lower(page_title)) > 1 order by page_touched asc;"`
- do
- echo "DUP FOUND [$page] - Bottom one is the more recent"
- for dup in `mysql $DBNAME -s -N -e "select page_title from mediawiki_page where lower(page_title) = lower('$page')order by page_touched asc;"`
- do
- echo "$URL?title=$dup&action=delete"
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement