Header
Backup a MySQL database and gzips use bash script
in: Linux  So/Code: Generico Data: 20/08/2013
Ora: 12.27:36
Articolo visualizzato: 5998 volte

Managing a server, even very small, means the creation of backup procedures to protect our data from possible lost and fault.

This small bash script creates a backup of a specific MySQL database and gzips.The system I've used is to create a bash for each mysql database that I host and run it through cronjob.

The database zipped then I'll make it accessible by FTP to download it from a local server to a set time. In order to have a copy of everything always at hand. 
Below is the bash script that I use in the first part of my backup procedures.

# Back Up Mysql & GZIP
#!/bin/bash

FILE=/path/del/backup/sqlfile.sql
FILEBK=/path/del/backup/sqlfile.sql.gz

# DB Credentials
NAME=root
PASS=password
DB=databasename

// Remove old BK File
rm $FILEBK

echo "Content-type: text/plain"
echo
echo "Tried to export file: "$FILE

# MySQl Dump
mysqldump --quote-names -u $NAME --password=$PASS $DB > $FILE

# GZIP
gzip -v $FILE


Of course you can create a backup rotation or adding dates of the folders or the system date to the file name.

For any questions or concerns please leave a comment.

Commenti Commenti (2) | User Autore: Guido Camerlingo (Guiz)
Tags: linux bash backup mysql dump mysqldump script cronjob ftp





Articoli Correlati
Backup a MySQL database and gzips use bash script
Eseguire il backup di un database MySQL tramite bash e gzip
[MySQL] - Sql invididuare la settimana da una data
[JAVA - NETBEANS] Connessione a MySQL (Java Connector JDBC)
Delphi - case with string

Commenti
Da: Google Website Ora:12.39:08 Data: 31/01/2014

Great post. Did you write it yourself?
Google Website http://google.com

Da: seo plugin Ora:21.42:05 Data: 04/12/2015

Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword....wait there's even more Now what if i told you there was a simple Wordpress plugin that does all the On-Page SEO, and automatically for you? That's right AUTOMATICALLY, just watch this 4minute video for more information at. <a href="http://www.SEORankingLinks.com">Seo Plugin</a>
seo plugin http://www.SEORankingLinks.com/


Scrivi Commento
Codice Verifica

Commento massimo 5000 caratteri.(Tutti i campi contrassegnati da * sono obbligatori).

   

Ricerca

Glossario Naviga nel nostro glossario!
Scopri il gergo dei Geek!


 ULTIMI ARTICOLI

226 giorni fa
447 giorni fa

 [EN] Last Articles

 Siti Amici

Visita il Blog Roll
Contattaci! Diventa nostro amico!



 Hot Downloads


 Categorie

85
163
58
87
13
2
20
36
1
2
5
5
128
7
24
15
62
45

 Code

11
11
3
6
2
24
1
7

 Games

19
45
13

 GUIDE


 Novità Downloads

70
68
3833

 Tags Cloud

italia vegas pdl senza superato las vendita operazione 1.7.2 Eken amazon optitaly 1.7.2 windows 3d Eken Show in



 CopyRight

Valid XHTML 1.0 Transitional CSS Valido! [Valid RSS] Creative Commons License


Geek-Blog by Flavio Mandato, Giuseppe Vaccaro, Guido Camerlingo, Stefano Natale, Domenico Cavallo is licensed under a Creative Commons Attribuzione-Non opere derivate 2.5 Italia License.
Based on a work at www.geek-blog.it.
Permissions beyond the scope of this license may be available at http://www.geek-blog.it/

Disclaimer - Responsabilità - Pagina generata in 0.097 secondi. Geek-Blog.it