Ã¥°¥ÇÇ, ¸òÀº, ´ç½ÅÀÇ ¸¶À½¿¡ µå´Â À§Ä¡ Firefox¸¦ À§ÇÑ SiteHoppin Åø¹Ù¸¦ °¡Áø ¶Ú´Ù!



DIY ¸®´ª½º À¥ ¼­¹ö Àü¼¼ ¸¶Â÷ - ´ç½ÅÀÇ MySQL MySQL µ¥ÀÌŸº£À̽º ¹é¾÷À» ÀÚµ¿È­ÇϽʽÿÀ

¾ÈÀ¸·Î ¹èÄ¡ÇÏ´Â Blog, Â÷°¡¿î, DIY Zedomax, DoItYourself!, ±³À°, Àü¼¼ ¸¶Â÷, ¸®´ª½º, Ubuntu, À¥, Wordpress 2008³â2¿ù Á¦ 10 5:24 pm¿¡ ¿¡ ÃÖ´ë¿¡ ÀÇÇÏ¿©

ÁÁ¾Æ¿ä ³ª´Â ÇÑ ½Ö ¼ö³â°£ Àü¿ë ¼­¹ö¸¦ Áö±Ý ´Þ¸®°í ÀÖ´Ù ±×¸®°í ³ª´Â ´ëÇп¡¼­ ÈÄ¿¡ ¸®´ª½º »óÀÚ·Î ÁÖº¯¿¡ Èð¶ß·È¾ú´Ù.

¿©±â¿¡¼­ ÀÖ´Ù ´ç½ÅÀÇ ¹é¾÷À» ÀÚµ¿À̶ó°í À¯ÁöÇÒ ´ç½ÅÀÌ Çʿ䰡 ÀÖÀ» cron ÀÏ ¹× ±Ùº»ÀûÀÎ ÀÚµ¿ ¿øº».

´ç½ÅÀÌ Àü¿ë ¼­¹ö¸¦ ¾ò´Â °æ¿ì¿¡, ±×·¸½À´Ï´Ù ´ç½ÅÀÇ µ¥ÀÌŸº£À̽º º¸¿ÏÀ» À§ÇÑ ±×µéÀÇ ¾î¸®¼®Àº ¿©ºÐ $15/month¸¦ ¾òÁö ¸»¶ó.  (¸ðµÎ´Â ¸¸µé°í ÀÌ °Í °°ÀÌ ¿øº»À» À§Å¹ÇÑ´Ù ±×°ÍÀ» À§ÇØ ´ç½ÅÀ» ÀÌ´Ù)

´ç½ÅÀº ÀÌ º¸±â¸¦ µû¸¦ ¼ö ÀÖ°í °¡±â À§ÇÏ¿© °£½Ä Àú µ·¿¡ ¼ÒºñÇϽʽÿÀ.

´ç½ÅÀÌ ¿ÀÁ÷ ÇØ¾ß ÇÏ´Â ÀÌ·¸°Ô °ÍÀº FTP ´ç½ÅÀÇ ¹é¾÷ ÆÄÀÏÀÌ´Ù.

À̰ÍÀº ÆÄÀÏÀÌ ÀÌ¹Ì ´Ù¿î·ÎµåÇÏ°Ô ´ç½Å ÀÌ ÁغñµÇ¾î Àֱ⠶§¹®¿¡ÀÌ¾î ´ç½ÅÀÇ phpMyAdmin·Î µé¾î°¡°í ¹× À¥ °ø¿ë¿µ¿ª¿¡¼­ ´Ù¿î·ÎµåÇϱ⠺¸´Ù´Â ´õ ³ªÀº ¹æ¹ý.

¿©±â¿¡¼­ ´ç½ÅÀÌ ±×°ÍÀ» ÇÏ´Â ¹æ¹ý ÀÌ´Ù:

1) ºÒ¸° »õ ÆÄÀÏÀ» ¸¸µå½Ê½Ã¿À backup.sh ´ç½ÅÀÇ È¨ µð·ºÅ丮¿¡¼­. 2) µÚ¿¡ ¿À´Â Åë¾î·ÐÀ» »ç¿ëÇϽʽÿÀ:

mysqldump - u [»ç¿ëÀÚ À̸§] - p [¾ÏÈ£] - opt [µ¥ÀÌŸº£À̽º À̸§]  > /root/backup/DATABASE1.sql

º¸±â´Â ¿©±â¿¡¼­ ÀÖ´Ù 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/*

You can test your script by typing this:

sh backup.sh

(The mysqldump will overwrite the older file if you run this more than once)

3) If everything is working good, now you can put that script to be run once a day in your cron job.

For Fedora Core, you can edit this file /etc/cron.d/sa-update

Add the following line:

10 3 * * * root sh /root/backup/backup.sh

This will execute the script once a day at 3:10AM.

Now simply download one tar ball file whenever you feel like backing up your database.

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.

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

Related posts

, , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...