Tags: mtime date mysq mysqldump generate successful%s backup MySQL BakRequirements: Back up the MySQL database and upload the data backed up files to the FTP serverFTP Server IP Address: 192.168.6.9FTP Server account/password: test/test123 1. Root user creates backup script path: $ mkdir /opt/databak
$ cd /opt/databak 2. Create a
Share a self-written mysql automatic backup script, timed execution settings, and windows automatic FTP. Please advise. Prerequisites: vsftpd is enabled for the mysql database server and an appropriate account is configured for the Intranet storage server.
Share a self-written mysql automatic backup script, timed exec
========================================================== ==========This article isHeyuanhuiOriginal
Make sure that the original author information and original links of this article are complete and retained!
NN: khlerE-mail:Khler@163.comQQ: 23381103MSN:Pragmac@hotmail.com========================================================== ==========
Recently, a service named TWS is implemented in Linux. It outputs logs using Syslog and uses MySQL as the background database. I encountered two problems
statement in the exported file to specify the Binlog location of the current backup, which can be done if you want to restore the file to slave. 1.2 RestoreThe file backed up with Mysqldump is a SQL script that can be poured directly into it, and there are two ways to import the data.Directly with the MySQL clientFor example:/usr/local/mysql/bin/mysql-uyejr-pyejr Db_name Use SOURCE syntax (experiment not s
Tags: io ar os for file data on log BS@echo offSetlocal enabledelayedexpansionTitle%date%%time:~,8% by Liaoning Sunray Software Technology :: XXX Database backup:: Define Database SIDSet SID=ORCL :: Define user an array groups (spaces separated by each user for example: User1 user2 User3)Set USERARR=AAASet PSWDARR=BBB :: Specify the number of days to deleteSet daysago=3 :: Specify the backup pathSet Filepat
Today, the company asked me to copy the backup files on the server to the internal server, and as long as they are up-to-date, well, what is the ideal goal of O M personnel, that is, what can be done by computers, never do it by yourself.System: centos 5.9Environment: The backup file is under/root/bak. Of course, I tested it on a virtual machine.1. Backup file e
@echo offREM *********************mysql backup Script ***********************REM ***1, backup MySQL, generate jyz-2015-03-09_14.sql format File * * * *REM * * * The file name: Date _ When. DMP, customizable format * * * *REM * * * ensures that the number of DMP files in this directory is specified (i.e., deleted, retained for the last 10 days) * *REM ************
I failed to copy a backup script like laruence, and nobody was here-Linux general technology-Linux technology and application information. Here is the details. Z is a newbie, the level is shit, Mo Xiao: 0w223dc ...... To make an automatic backup can only be like this
Bird brother: # (Bird brother backs up/var/lib/mysql to/disk2/
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= "/var/log/mysqlbackup.log"[$?-eq 1] | | {echo "Usage: $ DATE"Exit 99}[-D $BACKUPDIR] | | Mk
= Time.strftime ('%h%m%s ')# Take a comment from the user to create the name of the tar fileComment = raw_input (' Enter a Comment: ')If len (comment) = = 0:target = Target_dir + today + os.sep + Now + '. tar.gz 'Elsetarget = Target_dir + today + os.sep + comment.replace ("', '-') + ' _ ' + Now + '. tar.gz '# Create The subdirectory if it isn ' t already thereIf not os.path.exists (target_dir+today):Os.mkdir (Target_dir+today)print ' Successfully created directory ', today# 5, We use the tar co
agoFind $ basepath-mtime + 7-name "*. SQL .tar.gz"-exec rm-rf {}\;Done # Delete the generated SQL fileRm-rf $ basepath/*. SQLTo support remote server backup, you can change the mysqldump parameter in row 17th to-p123456 followed by-h 192.168.1.123 remote ip.After the shell script is written, it is saved in the specified location, for example, in/home/backup_mysql/back_mysql.sh. Now we start to ru
#!/bin/bashcd= ' df-l |awk ' nr==3 {print $4} ' |awk ' BEGIN {fieldwidths= ' 2 1 "} ' {print '} 'If [$CD-ge 20];thenecho " hard disk space is full and cannot be backed up " | Mutt-s " backup alarm, please replace the hard drive in time " [Email protected] exit 1FiLogrotate-f/etc/logrotate.confTar zcf/opt/backup/' Date +%y%m%d%h%m '. tat.gz/var/log/messages.* >/dev/nullRt= ' echo $? 'If [$RT-eq 0];thenecho "
#!/bin/bash# every morning at 4, MySQL backs up data #chmod theBackup.SH#crontab-e#0 4* * * */home/erya/run/moniter/mysql_backup.SHUser="radius"Password=""Host="localhost"db_name="radius"#backup Directory Base_dir="/home/backup"Backup_log="${base_dir}/mysql_backup.log"Backup_path=${base_dir}#file InfoDate=$(Date+"%y-%m-%d") filename= $backup _path/$db _name-$Dat
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.