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
Vulnerability warning: FTP exposes a severe remote execution vulnerability, affecting multiple versions of Linux (with a detection script)
On July 6, October 28, a public email showed the FTP remote command execution vulnerability. The vulnerability affected Linux systems in
Copy codeThe Code is as follows :#! /Bin/bash
# Mysql autobackup shell
#
#
# -------------- Set the mysql login parameters
Dbuser = root
Dbpasswd =
Dbserver = localhost
Dbname = fwserver2008
Dbopt = -- opt
Backupdir =/dbbackup/
# --------------- Set the FTP paramters, 0 no send to a ftp server, 1 send to a ftp server
Copytoftp = 1
Ftpserver = 172.16.25.2
Ftpuser
☆☆☆ Daily automatic backup site data and database upload ftp☆☆☆
This way, the main is a script (including compressed site data and database, upload), and then use the cron command every day in a specified period of time to run, see the script code (script information needs to set itself)
The
I. First, let's look at the following in linux:
Copy codeThe Code is as follows :#! /Bin/bash
Cd/ftp/
CURRENTDATE = 'date + % Y % m % d'
YESTERDAY = 'date-d yesterday + % Y % m % d'
THREEDAYAGO = 'date-d' 3 days ago '+ % Y % m % d'
# Echo $ TWODAYAGO
Ftp-n-I 34.97.34.3 User ftpuser
Bin
Mput $ YESTERDAY .*
Delete $ THREEDAYAGO .*
Bye
!
Note: This
Linux-based FTP scripts:1#!/bin/SH2 3 4 CD5Echo"completely uninstall the original FTP"6sudo apt-GetRemove--purge vsftpd # (--purge option means complete removal of software and related files)7 8Echo"Installing the VSFTPD server"9sudo apt-GetInstall VSFTPDTen OneEcho"configuration file" A #匿名访问 -sudo sed-i-E's|anonymous_enable=yes|anonymous_enable=no|'/etc/vsftpd
Tags: this www ase shel path shell. com off mysqld1. Add backupmysqleveryday.sh (vi/data/shell/backupmysqleveryday.sh)#!/bin/sh#this Shell is the user for backup MySQL data everyday#author: www.ieliwb.com#path-configbase_mysql_path=/data/webserver/mysql/mysql_dump_path=/data/mysqlbackup/mnt_back_path=/mnt/web/mysqlbackup/ftp_back_path=mysql_data_backup/#mysql-configMysql_user= "Root"Mysql_pass= "*******"#ftp-configftp_host= "IP"Ftp_user= "********"Ftp
Preparatory work:
Need to advance in the VPS to install good lftp,lftp function more powerful, CentOS Direct execution: Yum install Lftp,debian execution: Apt-get install.
You need to create the/home/backup/directory on the VPS and create the backup directory on FTP.
If the VPS on the database is not much to use GoDaddy free space can (10GB space, 300GB traffic), as long as the registration of the domain name is free to send.
The following is a pa
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 backup space I am using GoDaddy online Storage, the advantage is that my VPS are the United States service provid
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 backup space I am using GoDaddy online Storage, the advantage is that my VPS are the United States service provid
Copy Code code as follows:
#!/bin/bash
#Mysql autobackup Shell
#
#
#----------------Set the MySQL login parameters
Dbuser=root
Dbpasswd=
Dbserver=localhost
dbname=fwserver2008
Dbopt=--opt
backupdir=/dbbackup/
#-----------------Set the FTP paramters, 0 No send to an FTP server,1 send to a FTP server
Copytoftp=1
ftpserver=172.16.25.2
Ftpuser=
Use the here document
Copy codeThe Code is as follows :#! /Bin/sh
Ftp-ivn 210.29.28.124 User yun yun2011
LCD/home/veyun
Cd/home/veyun/yhb
Get v
Bye
EOF
Explanation:
-I: Disable interaction prompts during multi-file transmission, so there will be no prompts for users to enter their usernames and passwords.-N: Automatic Logon during initial connection is blocked.-V: Set the ftp command to verbose mod
Use here documentation
Copy Code code as follows:
#!/bin/sh
FTP-IVN 210.29.28.124 User Yun yun2011
Lcd/home/veyun
Cd/home/veyun/yhb
Get V
Bye
Eof
Explain:
-I: Turns off interactive prompts during multiple file transfers, so there's no hint that users can enter user names and passwords
-N: Automatic logon When initial connection is blocked
-V: Set the FTP command to verbose mode so t
Regularly back up each server's shake data, to the FTP server, pay attention to the active mode and the passive mode difference#!/bin/bash# active FTP is beneficial to server, client iptables shutdown, client needs to execute Passsiveh after uploading data # Passive FTP is beneficial to client, server side iptables off, Linux
Linux Servers build FTP service scripts (tested on centos6.5 and CENTOS7) (the script does not make a judgment and needs to clean up the environment itself) (the script only allows uploads to not allow downloads, and does not allow anonymous users and local users to log on)Installation scripts#!/bin/bashSource/etc/rc.d
Why use this class?
Because of an egg ache project, Project Server in another company (referred to as company A) hands, company A, their servers do not open the network permissions, afraid of problems. Because the project is under development, so often need to upload PHP code to the server, because no permissions, so the upload code using the efficiency Super slow manual upload-_-, in my repeated request, finally opened a springboard machine ftp, eac
Objective:
The company has hundreds of Windows servers, every time the program is updated, if it is a table copy data, I am afraid to arrange 10 people, one day is not necessarily done, so it is necessary to study a full automatic update scheme, so I thought of FTP, do a primary FTP station, on hundreds of client computer to start bat script, Every 30 seconds det
Python ftp operation script common functions, pythonftp script
Fast ftp upload, download, and Query files
Use Python to perform ftp server operations
#!/usr/bin/python#ftp.py#this script is used to make some
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.