Skip to content

Instantly share code, notes, and snippets.

@djfm
Last active August 29, 2015 14:15
Show Gist options
  • Save djfm/af67eb0616b19c9b54e5 to your computer and use it in GitHub Desktop.
Save djfm/af67eb0616b19c9b54e5 to your computer and use it in GitHub Desktop.
Clean PSTAF shops
#!/bin/bash
echo "SHOW DATABASES LIKE '%tmpshpcpy%'" | mysql -h127.0.0.1 -P3307 -uroot | \
sed -n '1!p' | xargs -I{} mysql -h127.0.0.1 -P3307 -uroot -e "DROP DATABASE {}"
sudo rm -Rf /www/*tmpshpcpy*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment