In the past few days, due to business needs, we have provided a batch processing for our own use. Since we have never written this before, we may
It took a day to download files. It was so stupid, haha. If you have time, you may want to complete it into a common one. You can set several variables to achieve remote FTP file download.
You are also looking forward ......
Note: If the local file already exists,
Batch configure SSH mutual trust script and ssh mutual trust script
During large-scale automated deployment, we often need to configure SSH mutual trust on the server so that the automated script can log on to the remote server without password. The general steps to manually configure SSH mutual trust are as follows:
-- It is only suitable for running in the LAN. If the script is connected to an FTP server outside China, the stability of the script remains to be improved.
@ Echo Off Echo . Set Data = % Date :~ 8, 2% % Date :~ 5, 2% % Date :~ 0, 4% Echo Open IP address> ftp.txt Echo User Name> ftp.txt Echo Password> ftp.txtEcho Binary> ftp.txt Echo CD > Ftp.txt Echo LCD
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. Th
1. Batch processing with the parameter ping command@echo offecho Input you IP address ...set/p ip=echo Your IP number is%ip%.Ping%ip%Set ip=Pause2. Send Alarm ScriptFor counter = 1 to 3 Step 1SendMailNext Public Sub SendMail NameSpace = "http://schemas.microsoft.com/cdo/configuration/" Set Email = CreateObject (" Cdos. Message ") Email.from =" Server "' sender name email.to =" [emailprotected] "' Recipient e-mail address Email.subject = GetIP "T
the phyaddr.txt file, jump from the first line to the next line, that is, start from the third line, and set the value to the Mac variable, for example, physical address .........: 00-e0-fc-0c-a8-4f. Each continuous value is a symbol.Symbol 1: physicalSymbol 2: address.Symbol 3 :.Symbol 4 :.Symbol 5 :.Symbol 6 :.Symbol 7 :.Symbol 8 :.Symbol 9 :.Symbol 10 :.Symbol 11 ::Symbol-E0-FC-0C-A8-4FTokens = 12. Now you should understand it, but it is worth noting that the variables in the for command are
Automatic FTP script
Use the following script to implement automatic FTP, transfer the files you need to the desired place, or capture the files from somewhere.
CD/path_you_want_to_upload (download)
FTP-n
Open ip_address
User Username Password
ASCII (or bin)
Put * (or get)
Now there is a need to take a remote file below the image, download to the local, and delete the successful download of the file, and the remote directory of the image will be added at any time. Suppose that if all the scripts are written, then it is OK to call the scheduled task on Windows and execute the script on time, and Linux can use Cronjob as well. The general realization of the idea is as follows, of course, more than this one way.
B
FTP is a common application for accessing files, and it is also used for daily backups. This cyclical effort will undoubtedly need to be done through automated scripting. This system is CentOS7This experiment requires you to do the following:1. Modify the FTP server configuration file /etc/vsftpd/vsftpd.conf, the anon_upload_enable=yes, the previous comment is removed, that is, allow anonymous users to uplo
Share a self-written mysql automatic backup script, timed execution settings, and windows automatic FTP. Please advise.
Prerequisites: vsftpd is enabled on the mysql database server, and an appropriate account is configured for FTP
Step 1: Compile the mysql Automatic Execution script
#!/bin/sh
#mysql_db_backup.
In the past, the company used a Shell script to automatically back up MySQL to FTP on the Internet, which has always been used well. But the problem is that as the number of backup files increases, it is inconvenient to regularly clean up the old backup files on FTP. In fact, MySQL backup does not need to be retained for too long. It would be nice to have the fun
Preparations: lftp must be installed in VPS in advance. lftp is powerful. CentOS directly executes: yuminstalllftp and Debian execute: apt-getinstalllftp. You need to create the/home/backup/directory on VPS and the backup directory on FTP. If there are not many VPS databases, you can use Godaddy free space (10 GB space, 300
Preparations:
Lftp needs to be installed in VPS in advance. lftp is powerful and can be directly executed in CentOS:Yum install l
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 #ftp
Linux automatically backs up the MySQL database and uploads the shell script to the FTP server.#! /Bin/bash# Mysql autobackup shell### -------------- Set the mysql login parametersDbuser = rootDbpasswd =Dbserver = localhostDbname = fwserver2008Dbopt = -- optBackupdir =/dbbackup/# --------------- Set the FTP paramters, 0 no send to a
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
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.