Applied Web Technologies

Its all About Web

Follow me on TwitterRSS Feeds

  • Home
  • About Me

Think, when you were still a kid…

Sep 2nd

Posted by tawfekov in Others

No comments

kids, think

Bash Shell File to backup Mysql Server and Save it over FTP

Aug 27th

Posted by tawfekov in tutorials

No comments

today i was trying to move mysql server from one to another , so i had to use this bash shell file , and just wanna share it to public
1-requirement :
Good FTP Client like lftp , you can download it by : yum install lftp (redhat or any RPM dependent distro ) or apt-get install lftp (debian or ubuntu )

2-create file name “mysql.backup.sh”

and write down

#!/bin/bash
### MySQL Server Login Info ###
MUSER="root"
MPASS=""
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
BAK="/backup/mysql"
GZIP="$(which gzip)"
### FTP SERVER Login info ###
FTPU="ftpusernane"
FTPP="ftppassword"
FTPS="targetServer"
NOW=$(date +"%d-%m-%Y")
[ ! -d $BAK ] && mkdir -p $BAK || /bin/rm -f $BAK/*
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
FILE=$BAK/$db.$NOW-$(date +"%T").gz
$MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done
lftp -u $FTPU,$FTPP -e "mkdir /mysql/$NOW;cd /mysql/$NOW; mput /backup/mysql/*; quit" $FTPS

3- run this command  chmod +x mysql.backup.sh to give the file execute permission

4- one more tip , you can add it to crontab ……………….. so it can run automatically  as you want

easy , isn’t it ??

apt-get, backup, bash, debain, gzip, lftp, mysql, redhat, shell, ubuntu, yum

Intro to REST ….. taking advantages of HTTP Protocol

Jul 11th

Posted by tawfekov in Short tips

No comments



DELETE, GET, HEAD, HTTP, POST, PUT, REST, taking advantages of http protocol
12345»...Last »
  • Are you looking for something ?

  • Google Friend Connect

  • Ask a Question!

    Have a development question?
    A pressing business issue?
    Maybe I can help.

    Send your question to info at dagho dot com

  • Email Subscriptions

    Applied Web Technologies

  • Internet for Peace

  • Categories

    • Front End Web (2)
    • Others (9)
    • Short tips (14)
    • tutorials (5)
    • Zend framework (1)
  • Published under CC

    Creative Commons License
    Creative Commons Attribution 3.0 United States License

Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top