|
| |
Scripts
Multiple Search & Replace (recursive)
#!/usr/bin/sh
if [ $# -lt 3 ] ; then
echo -e "Wrong number of parameters."
echo -e "Usage:"
echo -e " $0 'filepattern' 'search' 'replace'"
exit 1
fi
find ./ -type f -name $1 -exec sed -i "s/$2/$3/" {} \;
Backup of MySql database, suitable for cron job
This will email the database to the person specified. Suitable to throw into a cron job and let it run once a week.
echo "Subject: MySql backup: `date`" > meckfil ; /bin/mysqldump --add-drop-table -h `/bin/mysqlbackups database | head -1` -uusername -ppassword database >> meckfil ; mail rocky@somedomainatsomeplacesomwhere.com < meckfil; rm meckfil
|
| |
|
|