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 #mysql密码
Ftp_user=vmvps #ftp用户名
ftp_pass=123456
Monitoring # tail-f/var/log/message to turn off the main service # killall-9 keepalived, you can see the backup service log output: mar 13 23:00:27 linux-backup Keepalived_vrrp: VRRP_Instance (VI_1) Transition to MASTER STATEMar 13 23:00:28 linux-backup Keepalived_vrrp: VRRP_Instance (VI_1) entering MASTER STATEMar 13 23:00:28 linux-
Using shell scripts to monitor and manage Oracle databases will greatly simplify DBA workload, such as common instance monitoring, monitoring, and alarm log monitoring, and database backup, AWR report automatic mail, etc. This article describes how to use the shell script in Linux to implement automatic FTP backup of files.
Linux Shell and Import and Export refer
Using shell scripts to monitor and manage Oracle databases will greatly simplify DBA workload, such as common instance monitoring, monitoring, and alarm log monitoring.
Using shell scripts to monitor and manage Oracle databases will greatly simplify DBA workload, such as common instance monitoring, monitoring, and alarm log monitoring.
Using shell scripts to monitor and manage Oracle databases will greatly simplify DBA workload, such as common instance monitoring, monitoring, and alarm log
Server more, the site is more and more, always feel not the whole backup heart, and there are several times RM operation errors, resulting in irreparable damage. And most VPS providers are not providing automatic backup functionality or this feature charges slightly higher prices. So it is necessary for me to put this work into practice, and maybe one day it will be used.
Use of the
"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, dire
Tags: upload ftp automatic backup MySQL
The previous MySQL daily backup shell script gives a script that uses mysqldump to back up to the local, followed by a script that uses FTP to transfer the backup file to the remote server. Of course, can also use Scp,rsync an
Server more, the site is more and more, always feel not the whole backup heart, and there are several times RM operation errors, resulting in irreparable damage. And most VPS providers are not providing automatic backup functionality or this feature charges slightly higher prices. So it is necessary for me to put this work into practice, and maybe one day it will be used.
Use of the
My previous project, use the Bat+windows scheduled task to automatically back up data to a backup server.In the handover, write this thing out and hopefully inspire you to use the bat script more.One. Prepare and write the bat file for ease of maintenance split 3 files are: Bakmain.bat bakdatalog.bat (compressed and write log) ftp.txt (FTP command file)Bakmain.bat@echo OffSET spath = REM log path defaults t
This script checks the data integrity of remote backup to the ftp server and whether ftp is sent to the server, if the ftp server is not backed up in time, the script will trigger the SMS alarm function module to generate an SMS alarm. Finally, due to the limited space on the ftp
How to implement automatic backup
Five. Sh files are provided in this directory.Script files, which have the following functions:
1. Export. Sh -- export all tables whose owner is zhaoilei in the database
2. hotbackup. Sh -- full database backup for the database
3. rm. Sh -- delete useless backup and export information
4. rmsh. Sh -- trigger the first three scr
First, install LFTP environment
Because we need to use the LFTP environment when uploading FTP files, we can't make sure all the systems are installed, so we'd better reinstall them first.
The code is as follows
Copy Code
#CentOS Yum Install lftp
#Debian Apt-get Install Lftp
Second, create a backup directory
[Mysql] ftp automatically uploads mysql backup files
In the previous article, mysql daily backup shell script provided the script to back up data to the local device using mysqldump. The following is the script to transmit the backup file to the remote server using ftp.
Backup of FTPPurpose : through Shell to upload the backed-up data to another server. FTP back up the server. Simulation Tomcat for production data. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7D/BB/wKioL1bvOoaiyYeLAAAjXEUp800094.png "title=" 1.png " alt= "Wkiol1bvooaiyyelaaajxeup800094.png"/>Environment:node1:192.168.1.220 FTP Client Production Se
Label:For DBAs, backing up and refreshing resumes is two of the most important tasks, and if a failure occurs and the backup is not available, then the importance of refreshing the resume appears, wow! Of course, backup is the most important thing for DBAs (not one), and in a conditional scenario, we should keep multiple full and log backups on multiple servers, and even some companies will require complete
Using a remote server, FTP operations on another remote server are much faster than local machine operations.Previously wrote an article about how FTP is manually remotely operated on Linux,Today I found an automated batch script that feels good. Meet my needs.My a site in Hong Kong my B server Linux in the country. This allows the a site to be automatically backed up to B server.Hope this blog can give the
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
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.