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
We know that script commands for backup and restoration are also provided in IIS Server 6, allowing you to back up and restore local or remote IIS configuration information in the command line state. In this way, when you work in other departments, as long as you can access the Internet, you do not need other tools to complete the backup and recovery of IIS serve
Hot Standby shell script file mysql1 # cat mysqlbackup. sh #! /Usr/local/bin/fish # The backup policy is daily full backup # set the backup path variable set backupdir/usr/db/backup # generate the backup Directory mkdir-p $ backup
Tags: data shell crontab MySQL backup
Use mysqldump to back up MySQL data for a fixed time of day.
#!/bin/bash
#每天早上4点, MySQL backup data orangleliu
#chmod backup.sh
#crontab-E
#0 4 * * */home/erya/run/moniter/mysql_backup.shUser="radius"password=""host="localhost"Db_name="radius"
#backup DirectoryBase_dir="/home/
The first time to learn python written script 650) this.width=650; "src=" Http://img.baidu.com/hi/tsj/t_0015.gif "alt=" T_0015.gif "/>The original script of the first script in the concise Python tutorial is as follows#!/usr/bin/python#filename:backup_ver1.pyimportosimporttime#1.the Filesanddirectoriestobebackeduparespecifiedina list.source=['/home/swaroop/byte '
First step: Define your backup directory on your Linux server:
The code is as follows
Copy Code
Mkdir/var/lib/mysqlbackupCd/var/lib/mysqlbackup
The second step: The following is the most important step, is to write a scheduled backup script.
The code is as follows
Copy Code
VI dbbackup.sh
First step: Define your backup directory on your Linux server:
Copy Code code as follows:
Mkdir/var/lib/mysqlbackup
Cd/var/lib/mysqlbackup
The second step: The following is the most important step, is to write a scheduled backup script.
Copy Code code as follows:
VI dbbackup.sh
The code file is as follows
Tags: OCR gre date. SH User crontab grep linu stepLinux system mysql5.6 version for automatic backup steps1. sudo mysql--help | grep my.cnf Find my.cnf file2, add the following line in the file to implement the password-free[Mysqldump]User=your_backup_user_name (user)Password=your_backup_password (password)3. Edit Backup Script back.sh#!/bin/bashDate= ' Date ' +%
Tags: Oracle Local disk exp Backup LinuxPlease do not put the backup script under the Backup_dir, add to the crontab timer run#!/bin/shExport Oracle_home=/u01/app/oracle/product/10.2.0/db_1Export ORACLE_SID=ORCLExport Nls_lang=american_america. Zhs16gbkExport Path=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
The first step: Define the backup directory in your Linux server:Copy the code code as follows:Mkdir/var/lib/mysqlbackupCd/var/lib/mysqlbackupThe second step: The following is the most important step, is to write a scheduled backup script.Copy the code code as follows:VI dbbackup.shThe code files are as followsCopy the code code as follows:#!/bin/sh# MySQL Data backup
As the company's website increases and the occupied space increases, write a script. Under incremental backup nbsp ;#! /Bin. bash # backup00: 00: 00week 'date + % u'date' date + % Y-% m-% d 'year' Date + % Y' month 'date + % m'day' date + % d 'bakpath/var/bak/webbakweb is occupying more and more space as the company's website increases, therefore, write a script
PHP Database backup Script
PHP Database backup Script
The code is as follows:
Backing Up the database
$host = "localhost";
$user = "root"; Database account
$password = ""; Database Password
$dbname = "MySQL"; Database name
The account number, password, and name are all transmitted from the page.
if (!mysql_conn
Not familiar with SQL use, but experience gained through project engagementWhat scenarios to choose to use script or backup:1: Use a script when you need to create a related library2: Use a backup when you need to restore to a state at a point in time or go to a version of a database, which also matches the
1. Oracle scheduled task:
Crontab-e
* ***/Home/oracle/workspace/scripts/bk_main.sh>/home/oracle/workspace/log/bk_err.log 2> 12. Main Control Program
/Home/oracle/workspace/scripts/bk_main.sh
#! /Bin/bash
Dat = 'date + '% m''
If ($ dat = 0 ))
Then
/Home/oracle/workspace/scripts/bk _. sh 0
Elif ($ dat % 50 = 0 ))
Then
/Home/oracle/workspace/scripts/bk _. sh 2
Elif ($ dat % 40 = 0 ))
Then
/Home/oracle/workspace/scripts/bk _. sh 2
Elif ($ dat % 30 = 0 ))
Then
/Home/oracle/workspace/scripts/bk _.
Previously, I did not pay much attention to my blog. I felt distressed when I lost my blog. Now I am paying attention to it and decided to regularly back up SQL statements. Write a script as follows:
Copy codeThe Code is as follows :#! /Usr/bin/perl
Use warnings;
Use strict;
Use MySQL: Backup;
Use Mail: Sender;
Open my $ tmp_ SQL, '>', "backup. SQL ";
My $ mb = n
, "\" before adding "\" to achieve escape.3. Change "\" to "/",Correct the wrong backup successBackup succeeded to D:\backup\20171105151908.7zAbout the STRFTIMR functionCheck the function data as follows:GrammarStrftime () method syntax:Time. Strftime(format[, T]) Parameters
Format--formatting string.
T--optional parameter T is a Struct_time object.
Python format symbols in time Date
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
#!/bin/bash#auto backup MySQL Shell#by Csy 2015-11-11#自动备份数据库, and add a task plan script#定义变量 ===============Bak_cmd=/usr/bin/mysqldumpBak_host=localhostBak_db=csyBak_user=rootBak_pass= "123456"bak_dir=/tmp/mysqlbackup/Bak_date= ' DATE +%f '#环境测试 .....If [$UID-ne 0];thenECHO-E "\033[32m must use the root user to execute this script. \033[0m"ExitFiif [!-D $BAK _d
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.