Alibabacloud.com offers a wide variety of articles about mysql backup shell script, easily find your mysql backup shell script information here online.
First, install email send program
Copy Code code as follows:
Yum Install SendMail Mutt
Second, install the FTP client program
This script needs to use an FTP client program to upload files to the FTP space, so you must install the FTP client, otherwise the FTP command will not find an error.Installation steps please refer to: "CentOS tip ftp:command not Found"
III. Create a new sc
Programs on the Linux server update the MySQL database every day, so remember to write a shell script, combined with crontab, to back up the database regularly. Actually very simple, the main is to use the mysqldump command with MySQL.
#!/bin/bash # Shell
Rman backup is easy to use and inexpensive for Oracle database backup and recovery. For non-catalog mode, it is undoubtedly the first choice to embed Rman scripts into shell scripts and then use crontab to make small database database backups. This article provides an easy-to-use Rman backup
Mysqldump full backup shell script sharing today, the tester urged that the relevant bug database data must be backed up, and the full backup should be performed on a daily basis; for this database with a small amount of data, I feel that it is not necessary to become a mentor so that I can develop two sets of solution
MySql Data backup script (not original), mysql Data Backup
Create a file xxx. bat with the following content:
@ Echo offSet hour = % time :~ 0, 2%If "% time :~ 0% % "=" "set hour = time :~ 1, 1%Set now = % Date :~ 0, 4% % Date :~ 5, 2% % Date :~ 8, 2% % hour % Time :~ 3,2%
; $logfile - Bin_backup $ if [$?-eq 0];then the echo "$ (date +"%y-%m-%d%h:%m:%s ") [Note] MySQL binary log file backup is finished" >> $logfile the chmod-r $backup _binlog the Else the echo "$ (date +"%y-%m-%d%h:%m:%s ") [Warning] Mysql binary log file backup is not complet
MySQL database Regular automatic backup script, mysql database scriptThe most important thing for a Web system is the security and integrity of the database.It is very important to back up data regularly. Do not be lazy on this issue. If your important data is lost, it will make you cry.Export table structure and data
Shell Script Rollup 1 Name the backup file by month date#!/bin/bash# Create a back package for MySQL of the ball and web of ballcloud## backup mysql-ball and web for BALLCLOUDCD/www/web/backup_ballcloud/year= ' Date +%y ' month= '
;/backup/rman_fullbackup . Log Crontab-e * * * sh/backup/rman_backup.sh >>/backup/rman_fullbackup. Log 3. Understanding the crontab format Shell=/bin/bashPath=/sbin:/bin:/usr/sbin:/usr/binMailto=roothome=/# for details see Mans 4 Crontabs# Example of Job definition:#.----------------Minute (0-59)# | .-------------Ho
RMAN backup is easy to use for Oracle database backup and recovery, with low costs. For non-catalog mode, it is undoubtedly the first choice to embed the RMAN script into the shell script and then use crontab to back up small and medium databases. This document provides an e
Tags: blank database target MySQL periodichttp://hongge.blog.51cto.com/ Backups of MySQL databases in a production environment are recurring operations, so it is common to write script implementations that periodically execute backup scripts through Crond scheduled tasks mysqldump
The library to be backed up, passed in as an argument, delete the backup file from the previous 30 daysThe backup directory is created if it does not exist,/back/mysql/#!/bin/bashDatabase=$1Username= "Root"Passwd= "Redhat"Backupdir= "/backup/mysql"Curdate= ' Date +%f 'Log= "
Case one: Shell+cron realize MySQL automatic backup and automatically delete n days before backup
Copy Code code as follows:
#!/bin/sh
Dump=/usr/local/mysql/bin/mysqldump
out_dir=/home/ldl/xxx/backup/
Linux_us
Tag: style blog HTTP color file 2014
Recently, when learning about Jenkins, there is a problem: the number of subdirectories under the Linux ext3 system directory cannot exceed 31998 (refer to: http://www.xshell.net/linux/1267.html), but Jenkins does not stop compiling versions, sometimes a directory of more than 30000 log folders is created in a few hours, so that you can clean up the directories in this folder at any time. So I wrote a script to imp
1 Ensure that you are in the home directory (if not, run: cd/home)2 New Backup folder (command: mkdir backup)3) New Script backup.shVI backup.sh
Copy the following code (after replication: wq! to save):
Copy Code code as follows:
#!/bin/bash
#你要修改的地方从这里开始
Mysql_user=root #mysql用户名
mysql_pass=123456 #
"server_ip="192.168.88.103"USER="Anonymous"PASS=""FTP=/usr/bin/FTP$FTP-N$SERVER _ip$USERQuote PASS$PASSBinaryget$GET _filenameCD Uploadput$PUT _filenameEOFNote : The FTP username and password are written in clear text in the script, which may be a security risk, separating the user name and password,5. By default, directly with the FTP command and press ENTER will enter the FTP automatic login mode, at this time the FTP command will read the user home
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.