Created
December 27, 2017 17:48
-
-
Save maoueh/d26b2098f84d2228293508840ae071f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# From shell command line, with a MySQL database dump of the videos database, this | |
# shell command line will print all the duplicates duplicate string. | |
# | |
# Replace the `<...>` string by actual values for your system. Also, I use | |
# hard-coded IP in my database which result in the used Regex | |
# (`"'smb://.+?/.+?\.([a-zA-Z0-9]+)'"`). It's general enough but you might need | |
# to update it to your needs. | |
# | |
# OS: Mac OS X (10.11.6) | |
# Shell: ZSH | |
# Dependencies: Docker | |
# | |
mkdir /tmp/kodi-mysql-dump | |
cd /tmp/kodi-mysql-dump | |
docker run -it --rm mysql:5.7 /usr/bin/mysqldump -h<DB_IP> -u<DB_USER> --password='<DB_PASSWORD>' <DB_NAME> > videos.sql | |
awk -v RS=, 1 videos.sql | grep -E -o "'smb://.+?/.+?\.([a-zA-Z0-9]+)'" | sort | uniq -c | grep -v '^ *1 ' | sort -nr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment