Bookmark, share, and hop your favorite sites with SiteHoppin Toolbar for Firefox!ブックマーク、共有、およびホップしてお気に入りのサイトがFirefox用ツールバーのsitehoppin !

Back: 1/2 of UK Men Would Give Up Sex For A TV?!?先頭: 1 / 2の英国の男性はセックスをあきらめ、テレビですか? !ですか?

Forward: What is Soju and How Does it Affect an Entrecard (Ab)user’s Life進む:何がどのように影響を与える焼酎とentrecard (アルバータ)のユーザーの生活


DIY Linux Web Server HACK - Automate your MySQL MySQL database backups LinuxのウェブサーバーのDIYハック-M ySQLのM ySQLデータベースのバックアップを自動化して

Posted inに投稿された Blogブログ , Cool涼しい , DIY Zedomax zedomaxのDIY , DoItYourself! doityourself ! , Educational教育 , Hackハック , Linuxリナックス , Ubuntu ubuntu , Webウェブ , Wordpress WordPressの by max on the February 10th, 2008 at 5:24 pmを上限に、 2008年2月10日は5:24 pmの

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.本当の冗長性を保持物事が発生した場合はサーバーに障害が発生します。

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,



1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet) (評価はまだありません)
Loading ... Loading ...読み込んでいます...


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関連記事



TrackBackトラックバック

Email this to a Friendこの電子メールを友人に送る Email This Post Email This Postこの投稿をメール送信

RSS feed RSSフィード

5 Comments 5件のコメント »

Comment by コメント Mike マイク
2008-02-11 02:24:34 2008年2月11日午前2時24分34秒

Very useful script.非常に有用なスクリプトです。 Thanks.ありがとう。

http://packratstudios.com

myavatars 0.2
Comment by コメント max マックス
2008-02-11 07:15:11 2008年2月11日午前7時15分11秒

glad it helped!うれしいこと助け!

myavatars 0.2
Comment by コメント Brian Gaut ブライアンgaut 購読して電子メールでコメント
2008-02-11 05:22:04 2008年2月11日午前5時22分04秒

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

myavatars 0.2
Comment by コメント max マックス
2008-02-11 07:14:54 2008年2月11日午前7時14分54秒

true, that’s if you are using Linux…wait a minute, why am i not using linux!?! trueの場合、それを使用する場合はLinuxの…ちょっと待って、なぜ私がリナックスを使用していない!ですか? !

myavatars 0.2
Comment by コメント Craig Beckta クレイグbeckta 購読して電子メールでコメント
2008-06-05 16:10:43 2008年6月5日16時10分43秒

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クレイグ

myavatars 0.2
Name (required) 名前(必須)
E-mail (required - never shown publicly) 電子メール(必須-決して公表)
URI ヨルリンウリ

Subscribe to comments via email 電子メールでコメントをチャンネル登録
Your Comment ( あなたのコメント( smaller size 小さいサイズ | | larger size 大きいサイズ )
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment. <aのhref=のtitle=使用することがあります<acronymのtitle= <b>ダウンロード<abbrのtitle= <blockquote cite=""> <cite>の<code> <デル日時= " " > <q cite="">の<em> <i>て<strike> <strong>にしてコメントは得られなかった。