Back: 1/2 of UK Men Would Give Up Sex For A TV?!?先頭: 1 / 2の英国の男性はセックスをあきらめ、テレビですか? !ですか?
DIY Linux Web Server HACK - Automate your MySQL MySQL database backups LinuxのウェブサーバーのDIYハック-M ySQLのM ySQLデータベースのバックアップを自動化して
Okay, I’ve been running dedicated servers for couple years now and I used to mess around with Linux boxes back in college.オーケー、私は今すぐ実行して専用のサーバーを2,3年使用されると私をめちゃくちゃにするのLinuxボックスをオンに先頭で大学に入学した。
Here’s an essential automatic script and a cron job you will need in order to keep your backup automatic .ここに欠かせない自動スクリプトとcronジョブをする必要がありますを維持するために自動バックアップします。
Yes, if you get a dedicated server, don’t get their stupid extra $15/month for backing up your database. (All they do is make scripts like this one and charge you for it)はい、取得する場合には専用のサーバーで、自分たちの愚かなエキストラはありません$ 15/monthためのデータベースのバックアップを作成します。 (彼らはこのように1つのスクリプトを充電すること)
You can follow this example and go spend that money on junk food.この例で行く以下とすることができますそのお金でジャンクフードを食べて過ごす。
So all you have to do is FTP your backup files.ため、すべての必要がこれを行うには、 FTPのファイルをバックアップします。
This is way better than going into your phpMyAdmin and downloading from the web interface since the file is already ready for you to download.これはphpMyAdminの方法として行く以上のWebインターフェイスからダウンロードして以来、ファイルをダウンロードするには、すでに準備をします。
Here’s how you do it:ここでどのように行うこと:
1) Make a new file called backup.sh in your home directory. 1 )と呼ばれる新しいファイルにbackup.shを自分のホームディレクトリにコピーします。 2) Use the following syntax: 2 )を使用して、以下の構文:
mysqldump -u[USERNAME] -p[PASSWORD] –opt [DATABASE NAME] > /root/backup/DATABASE1.sqlのmysqldump - u [ユーザ名] - p [パスワード] -選択[データベース名] > / root/backup/database1.sql Here’s an example backup.sh file if you had 2 databases: backup.shファイルの例を次に示しますデータベースの場合は2 :
mysqldump -uUser1 -pPassword1 --opt Database1 > /root/backup/Database1.sql mysqldump -uUser2 -pPassword2 --opt Database2 > /root/backup/Database2.sql tar cvf /root/backup/sqlbackup.tar /root/backup/* mysqldumpを- uuser1 - ppassword1 -選択d atabase1> / r oot/backup/database1.sqlのm ysqldump- u user2- p password2-選択da tabase2>/ r o ot/backup/database2.sqlタールのc v f/ルート/バックアップ/s q lbackup.tarを/ r o ot/バックアップ/ * You can test your script by typing this:を入力してスクリプトをテストすることができますこの:
sh backup.sh件名標目backup.sh (The mysqldump will overwrite the older file if you run this more than once) (古いファイルが上書きさのmysqldumpを実行する場合は、この2回以上)
3) If everything is working good, now you can put that script to be run once a day in your cron job. 3 )の場合作業すべてが良い、今すぐに見せることもできますが一日に一度に実行するスクリプトをcronジョブにしています。
For Fedora Core, you can edit this file /etc/cron.d/sa-updateはFedora Core 、編集することができます。このファイル/ etc / cron.d /に-更新プログラム
Add the following line:次の行を追加します:
10 3 * * * root sh /root/backup/backup.sh 10 3 * * *ルート件名標目を/ root /バックアップ/ backup.sh This will execute the script once a day at 3:10AM.これにより、スクリプトを実行して一日に一度は3:10 AMのです。
Now simply download one tar ball file whenever you feel like backing up your database.今すぐ、単に1つのtarボールをダウンロードするファイルのバックアップを作成する際にデータベースを感じています。
You can probably change this a little bit and use it for many other things like backing up all your files too.おそらくこれを変更することができます。少々を使って、数多くのもののようなすべてのファイルのバックアップが判明しました。 (which I do) (私は)
If you have multiple servers like me, you can also automate your scripts to download backup databases to each server.私のようなサーバーが複数ある場合は、自動化することもできますし、スクリプトをダウンロードし、各サーバーのデータベースをバックアップします。 That keeps things real redundant in case of server failure.本当の冗長性を保持物事が発生した場合はサーバーに障害が発生します。
If you like this post then please subscribe to myこの投稿のような場合に入力し、登録してマイ full feed RSS完全フィードのRSS .です。 You can also subscribe byチャンネル登録をすることもできます。 Email電子メール .です。
Got a new hack, DIY, howto, or gadget?新たなハッキングは、のDIY 、手引きか、またはガジェットのですか? Tip us hereヒントはこちら .です。
Search for a Hack:検索するには刻み目:
Bookmark It!ブックマークしよう!
| Digg itいること | SiteHoppin sitehoppin | Wagg It waggこと |
Related Posts関連記事
- Zedomax Server Upgrade Complete! zedomaxサーバーのアップグレードが完了しました。
- Data Browser allows you to manipulate MySQL database in a Snap!データブラウザを使用するとMySQLデータベースの操作を簡単に!
- DIY Wordpress HACK - How to decrease the load on your Wordpress blog by 5 factors!のDIY WordPressのハック-どのようにしてW ordPressの負荷を減少させる要因のブログを5 !
- Why not host yourselfなぜ特定のホストに
- DIY Linux DoS HACK - HOWTO Limit your the max number of TCP connections to your Web Server!リナックスのDIY DOSのハック-の手引きの最大数を制限して、 T CP接続をウェブサーバーに!
TrackBackトラックバック
Email this to a Friendこの電子メールを友人に送る
Email This Postこの投稿をメール送信 






















Very useful script.非常に有用なスクリプトです。 Thanks.ありがとう。
http://packratstudios.com
glad it helped!うれしいこと助け!
To further automate the process of backing up, you should set up a LOCAL cron job that downloads the file to your computer.をより詳細なバックアッププロセスを自動化する場合は、設定するにはローカルcronジョブをお使いのコンピュータのファイルをダウンロードしています。
Which is just as easy….これは同じように簡単に… 。 all ya do fetch the remote file:すべてのyaは、リモートのファイルを取得:
wget wgetの ftp://Username:Password@www.yoursite.com/backup/sqlbackup.tar ftp://username:password @ www.yoursite.com /バックアップ/ sqlbackup.tar
true, that’s if you are using Linux…wait a minute, why am i not using linux!?! trueの場合、それを使用する場合はLinuxの…ちょっと待って、なぜ私がリナックスを使用していない!ですか? !
Cool script.クールスクリプトです。
I’ve always used a software product to backup my DBs - it was something like database backup generator.私は常に使用されるソフトウェア製品をバックアップし、私のDBS銀行-それは何かのようなデータベースのバックアップ発電機です。
You set it to run daily and it’ll back up, email you a download link, and also store as many backups as you need.を設定することとそれを実行する毎日のバックアップを作成、電子メールをダウンロード、広告のリンク、またできるだけ多くのバックアップとして保存する必要があります。
The thing I liked was that you could restore the DB with one click from the admin panel.私は気に入って復元することが1つには、 dbからのadminのパネルをクリックします。
Craigクレイグ