baktime=$ (date +%y%m%d%h%m%s) find/usr/local/auto_databasebak-mtime +4-type f-exec/bin/rm {} \; /usr/local/mysqlmysql/bin/mysqldump-h127.0.0.1-uroot-ppwd--opt-r--single-transaction xj_gameserver | gzip > /usr/local/auto_databasebak/dbbak_xj_gameserver_$baktime.sql.gz /usr/local/mysqlmysql/bin/mysqldump-h127.0.0.1-uroot-ppwd--opt-r--single-transaction xj_gameserver_18 | gzip & Gt /usr/local/auto_databasebak/dbbak_xj_gameserver_18_$baktime.sql.gz /usr/local/mysqlmysql/bin/mysqldump-h127.0.0.1-uroot-ppwd--opt-r--single-transaction xj_gameserver_17 | gzip & Gt /usr/local/auto_databasebak/dbbak_xj_gameserver_17_$baktime.sql.gzHow Linux compresses the retention source files:
gzip–c filename > filename.gz
How Linux unlocks the retention source file:
Gunzip–c filename.gz > FileName
The use of Gunzip
1. Role
The Gunzip command function is to unzip the file and use the permissions for all users.
2. Format
Gunzip [-acfhllnnqrtvv][-s] [File ...]
or Gunzip [-acfhllnnqrtvv][-s] [catalogue]
3. Main parameters
-A or--ascii: use ASCII text mode.
-C or--stdout or--to-stdout: Outputs the extracted file to the standard output device.
-F or-force: Forcibly unpack the compressed file, ignoring the existence of the file name or hard connection, and whether the file is a symbolic connection.
-H or--help: online Help.
-L or--list: Lists information about the compressed file.
-L or--license: Displays version and copyright information.
-N or--no-name: When decompressed, if the compressed file contains the original file name and time stamp, it is ignored and not processed.
-N or--name: When decompressed, if the compressed file contains the original file name and time stamp, it will be stored back to the unpacked file.
-Q or--quiet: No warning message is displayed.
-R or--recursive: recursively handles all files and subdirectories under the specified directory.
-S or--suffix: changes the compressed word-ending string.
-T or--test: Tests whether the compressed file is correct.
-V or--verbose: Displays the instruction execution process.
-V or--version: Displays version information.
Linux Mysql Database backup script