Welcome to the Linux community forum and interact with 2 million technical staff. Today, I wrote a mysql backup, mainly using the mysqldump tool. The requirement is to back up some databases at three o'clock every day and keep the backups for two days. Simple requirement. The following script #! Binshdbs $ (echo 'usrbinmysql-uroot-ppasswd-s-eshowdatab
Welcome to the Linux community forum and interact with 2 million technical staff> today, I wrote a mysql backup, mainly using the mysqldump tool. The requirement is to back up some databases at three o'clock every day and keep the backups for two days. Simple requirement. The following script #! /Bin/sh dbs = $ (echo '/usr/bin/mysql-uroot-ppasswd-s-e "show datab
Welcome to the Linux community forum and interact with 2 million technicians>
Today I wrote a mysql backup, mainly using the mysqldump tool. The requirement is to back up some databases at three o'clock every day and keep the backups for two days. Simple requirement: The following script
#! /Bin/sh
Dbs = $ (echo '/usr/bin/mysql-uroot-ppasswd-s-e "show databases;" | egrep-v "cece_schema | information_schema | test | mysql "')
Bak_name = 'hostname' 'date' + % Y % m % d % H % m''
/Usr/bin/mysqldump-uroot-ppasswd -- single-transaction -- databases $ dbs>/data/backup/$ bak_name. SQL & gzip/data/backup/$ bak_name. SQL
/Usr/bin/find/data/backup/-type f-mtime + 2-exec rm-f {}\;
Crontab settings
0 3 ***/bin/sh/root/script/backup. sh>/dev/null 2> & 1