This is the administrator of a small and medium-sized Linux website. The system architecture is RHEL 4.0 + PHP 4.3 + Mysql 4.03 + Apache 1.23. The average daily IP Access volume is 200, a typical small Linux website. Because it is a small website, there is no cost to use a tape drive for system backup, using a DVD Disc recorder + network hard disk. As Linux is widely used, especially in network applications, a large number of network servers use Linux operating systems. Because there are still some differences between Linux desktop applications and Windows, in enterprise applications, Linux and Windows operating systems often coexist to form a heterogeneous network. Most servers use Linux and Unix, while Windows 9X/2000/XP is used on PC.
I. local backup
Using mysqldump for backup is very simple. to back up the database "phpbb_db_backup", run the following command:
# Mysqldump-u-p phpbb_db_backup>/usr/backups/mysql/phpbb_db_backup.2005.5.6
You can also use the gzip command to compress the backup file:
# Mysqldump phpbb_db_backup | gzip>/usr/backups/mysql/phpbb_db_backup.2005.5.6. Gz
Run the following command to restore data:
# Mysql-u-p phpbb_db_back </usr/backups/mysql/phpbb_db_backup.2005-5-6
Ii. Back up data to a DVD Disk
With the increase of MYSQL Data volume, the use of traditional CD-R to back up the hard disk is not realistic, using CD-RW volume production is too much trouble, tape drive for small and medium enterprises and too expensive. In addition, the complexity of each application is increasing daily and dramatically, and the amount of data processed is also quite large. Linux users often encounter the problem of: Is there any way to back up and store data economically and quickly. As the prices of the DVD recorder and disc quickly decrease, it is wise to use the DVD recorder to back up the Linux operating system.
1. Installation
The following describes how to use a DVD recorder in a Linux environment by taking the built-in burning device of the IDE interface as an example. In Linux, You need to virtualize the burning device of the IDE interface to a SCSI device to burn a DVD. Linux Versions later than 2.4 contain SCSI simulation compiled into the kernel, so you only need to make some minor changes to the Startup File; USB or 1394 (FireWire) the external recorder of the interface is much simpler.
Connect the DVD recorder device to the second IDE interface (dev/hdc) of the computer and turn on the power. Assume that the system starts with Grub and opens/boot/grub in a text editor. conf, locate the line starting with "kernel" and add "hdc = ide-scsi" to the end of the line, for example: "kernel/vmlinuz-2.4.20-8 ro root = LABEL =/hdc = ide-scsi ".
2. Install the recording software
DVD + RW-Tools: a software toolkit containing a DVD and an image, including Growisofs and dvd + rw-format. Official station: http://fy.chalmers.se /~ Appro/linux/DVD + RW /,
CDRDAO: DAO is Disk-At-Once (Real-time recording), which is a two-second buffering method without audio tracks during the burning process. It can completely control the disk layout and track. This function is quite helpful in burning multiple source disks.
Cdrtools: includes a set of tools for CD and DVD burning. Growisofs uses the mkisofs tool in this package when creating an image. You can use readcd to create an ISO image from an existing DVD. In addition, the Cdrecord application can be used to scan the CD/DVD recorder on the connection system and use it to burn an ISO image to a CD-R (W) disc. Usually most Linux versions include this software, you can also download to use: http://freshmeat.net/redir/cdrec... epage/cdrecord.html
Dvdrecord: Specifies the DVD recording software under the command line. The DVD burning in the command line can be used in many cases. For example, when we remotely access the host, the GUI on the machine cannot be started, or the machine cannot start the GUI for some reason. In addition, you also need to use the command line tool to complete automatic backup and other repeated functions.
The above describes the necessary software and related download URLs. The installation process is relatively simple and will not be repeated here.
3. command line burning
Use a DVD + RW-Tools to burn data
Growisofs is a DVD + RW-Tools tool. Growlsofs uses different methods to access its burning devices. It uses the Unix path under/dev to connect to the recorder. Different systems and releases use different paths for the recorder, so the best way is to view the help in the release. In some systems, a soft link named/dev/dvd is set to point to an available DVD recorder. In this article, use/dev/dvd to specify the recorder, if the path settings in the system are different, replace them with the appropriate path.
(1) format a DVD disc that can be read and written
You can use the DVD 10 RW-format Command provided in the dvd + rw-Tools toolkit. There are two ways to format a DVD: Quick Mode and full mode. Quick Mode:
# Dvd + rw-format-blank/dev/dvd
Full mode:
# Dvd + rw-format-blank = full/dev/dvd
(2) store files on a DVD dial:
Similar to a general CD, a DVD uses an ISO file system and the same general extensions (Joliet and RockRidge ). Growlsofs provides a simple method to store files or directories to a DVD dial. Use the mkisofs tool to create an image without burning the image before it is stored on the hard disk. The basic command format is as follows:
# Growisofs-dvd-compat-Z/dev/dvd-J-R/path/to/home/cao
This command is used to create an image and burn the file in the/path/to/home/cao directory to a DVD.