Tag Archives: bash

Recursively remove all .svn directories

Every now and then I find myself in a need to this simple task of recursively removing all .svn directories from a project tree: find . -name .svn -print0 | xargs -0 rm -rf Rather similar method can be applied … Continue reading

Posted in Posts | Tagged , | Leave a comment

MySQL Backup Script

#!/bin/bash prefix=mysql suffix=$(date +%F).sql filename=$prefix.$suffix mysqldump –opt -uroot -pxxx –all-databases > /backup/mysql/$filename cd /backup/mysql tar -cvf $filename.tar $filename gzip $filename.tar chown root:root /backup/mysql/$filename.tar.gz chmod 600 /backup/mysql/$filename.tar.gz rm $filename #SUBJECT=”MySQL Dump completed” #EMAIL=”my@email.com” #EMAILMESSAGE=”$filename created” #echo $EMAILMESSAGE | /bin/mail -s “$SUBJECT” … Continue reading

Posted in Posts | Tagged , , | Leave a comment