Difference between revisions of "CSC220 Lab 9: Automatic MySql Database Backup"
Line 9: | Line 9: | ||
=Where should you login?= | =Where should you login?= | ||
− | * The computer you are going to login to will be the one that will be doing the automatic backup. Because the setup will be saved on that server, it is important to pick one that is reliable and won't be restarted in Windows mode by somebody else (which could be the case with any of the hadoop1xx machines). | + | * The computer you are going to login to will be the one that will be doing the automatic backup. Because the setup will be saved on that server, it is important to pick one that is reliable and won't be restarted in Windows mode by somebody else (which could be the case with any of the hadoop1xx machines). This means that beowulf or grendel should be our candidates. Unfortunately, '''mysqldump''', the command we need to run to backup our databases is not installed on these machines. |
− | * So pick | + | * So pick one of the hadoop1XX machines to login to, but remember that these servers are not as reliable because they can be rebooted at any time. |
− | =MySqlDump= | + | =Running MySqlDump from the Command Line= |
− | * Login to your 220a-xx account on | + | ==Is it installed?== |
− | * | + | * Login to your 220a-xx account on one of the hadoop1XX servers |
+ | * Open a terminal (no need to ssh anywhere) | ||
+ | * run the following command | ||
+ | |||
+ | mysqldump | ||
+ | |||
+ | * and verify that the command is installed and is giving you its USAGE. | ||
+ | * Figure out what the full path of the command is using '''which''', and write it down: | ||
+ | |||
+ | which mysqldump | ||
+ | |||
+ | ==Backing up your 220a-xx database== | ||
+ | |||
+ | * Run the following command | ||
+ | |||
+ | |||
+ | mysqldump --opt --host=xgridmac.xxxxx.xxx --user=220a-xx --password=xxxxxx 220a-xx > 220a-xx_dump.sql | ||
+ | |||
+ | :where you need to replace the '''xxx''' parts with the proper information. | ||
+ | |||
<br /> | <br /> | ||
Revision as of 11:59, 21 November 2010
--D. Thiebaut 14:22, 21 November 2010 (UTC)
The goal of this lab is to setup a simple cron-based scheme to automatically backup your database every 24 hours. It requires the use of mysqldump which is standard on most linux system
Contents
Where should you login?
- The computer you are going to login to will be the one that will be doing the automatic backup. Because the setup will be saved on that server, it is important to pick one that is reliable and won't be restarted in Windows mode by somebody else (which could be the case with any of the hadoop1xx machines). This means that beowulf or grendel should be our candidates. Unfortunately, mysqldump, the command we need to run to backup our databases is not installed on these machines.
- So pick one of the hadoop1XX machines to login to, but remember that these servers are not as reliable because they can be rebooted at any time.
Running MySqlDump from the Command Line
Is it installed?
- Login to your 220a-xx account on one of the hadoop1XX servers
- Open a terminal (no need to ssh anywhere)
- run the following command
mysqldump
- and verify that the command is installed and is giving you its USAGE.
- Figure out what the full path of the command is using which, and write it down:
which mysqldump
Backing up your 220a-xx database
- Run the following command
mysqldump --opt --host=xgridmac.xxxxx.xxx --user=220a-xx --password=xxxxxx 220a-xx > 220a-xx_dump.sql
- where you need to replace the xxx parts with the proper information.