当前位置:网站首页>Automatically pack compressed backup download and delete bat script commands
Automatically pack compressed backup download and delete bat script commands
2022-07-28 16:22:00 【viqecel】
Be careful , If there are spaces in the path , Put double quotes
:: file does not exist . We need to establish , Prevent from being deleted by mistake . Causes the backup to fail
@echo off
SET SourceFile=C:\inetpub\wwwroot\Runtime\mysql_bak_rar\
if not exist %SourceFile% (
md %SourceFile%
)
:: Because some database files are running , Can't pack directly . So you need to copy from upload Copied to the upload1 in
copy D:\phpstudy_pro\upload\*.* D:\phpstudy_pro\upload1\
:: Pack copy ibck Indicates that the file name is named with the time of the current day
"C:\Program Files\WinRAR\WinRAR.exe" a -ag -ibck "D:\phpstudy_pro\upload2\bak.rar" "D:\phpstudy_pro\upload1"
::pause
:: Delete the copied copy
del /f /s /q D:\phpstudy_pro\upload1\*.*
:: Delete more than 7 Days of backup , Be careful ,\mysql_bak_rar This represents a folder , Don't add a slash behind ,
forfiles /p "C:\mysql_bak_rar" /s /m *.* /d -7 /c "cmd /c del @path"
::pause
Put the above code in Notepad , Then rename the file .bat The script file at the end , Double click to execute
If it is packaged in the server , How to automatically download to the local regularly after packaging , Here are instructions
https://blog.csdn.net/viqecel/article/details/54588430
Here is how to download .
About windows How to copy in the system , Pack the compressed backup and delete it yourself , Check here windows In the system , Copy file , Then package the compressed backup and delete it bat Script command _viqecel The blog of -CSDN Blog
utilize flashfxp The queue function of . And the task planning function of the computer . Realize the automatic download of files on the remote server to the local .
If , We will download the file to D:\phpStudy\WWW\auto_beifen
1、 Start by opening flashfxp, Connect to remote server , Then select remote , And local , Folder or file to be downloaded , If not selected , You cannot back up to the location we specified .
Pictured
2, Then select the directory or file to be downloaded remotely , Right click on the . Click again Selected queue
Here's the picture ,
3, After clicking , The lower left corner , A queue will appear . Right click on , Then choose Save as . The file named auto_beifen After saving to the desktop .
Copy it into the folder we created in advance D:\phpStudy\WWW\auto_beifen
The folder and file structure is shown in the figure below .
4, Schedule task scripts . Create in the folder above autobak.bat.txt This file , It's about
dir D:\phpStudy\WWW\auto_beifen*.fqf /b > D:\phpStudy\WWW\auto_beifen\files.log
for /f %%f in (D:\phpStudy\WWW\auto_beifen\files.log) do (start D:\Progra~1\FlashFXPE_xp510.com\FlashFXP.exe D:\phpStudy\WWW\auto_beifen%%f)
among Progra~1 In fact, that is Program Files The abbreviation of this folder , Because spaces cannot be used in the directory . So instead of
files.log Represents a temporary file , Don't worry about him . If your directory is different , Then replace the above batch .
D:\Progra~1\FlashFXPE_xp510.com\FlashFXP.exe This paragraph indicates the installation location of the software , See the figure below , Facing the running software . Second right click . Click properties , Target location , You can copy it . Pay attention to the space problem .
5, autobak.bat.txt Then put the end of this file .txt Get rid of , It becomes a script file . Double click the file , Let's see the effect
6, After the queue is established , In order to encounter the same file every time you perform automatic backup and download, you don't need to prompt whether to overwrite 、 Skip, etc , You can select the –> File transfer rules are set to :
“ When the dates are equal — skip ” Of course, there can be other rules
But be careful , One of the following options , No matching rules , Ask , Here you can choose . Otherwise, it may be missed .
7, Finally, the computer plans tasks , This specific online search . It's easy . in addition . Note the default transfer mode of the software . Choose binary here , To prevent problems .
边栏推荐
- 2021 肯特面试题2
- Note: the value is rounded up to ten, hundred, thousand, ten thousand
- Rust Getting Started Guide (crite Management)
- Two special functions (arrow function and method)
- Instructions for mictr01 Tester development kit (vibrating wire acquisition reader)
- JS bidirectional linked list 01
- 视频号找到金钥匙,抖音模仿后来人
- I'll show you a little chat! Summary of single merchant function modules
- Ethernet to RS485 serial port counter WiFi module LED light controller ibf165
- How to measure the vibrating wire sensor by vibrating wire acquisition module?
猜你喜欢

NTC, PT100 thermal resistance to 4-20mA temperature signal converter

I came across Digital Phoenix coordinate Xuhui Meiluo city in Shanghai

Remote serial port server (adapter) UART to 1-wire application

Dynamic programming -- digital statistics DP

laravel

魏建军骑宝马也追不上李书福

c语言编程当中两个!!的作用

js 优先级队列

Telecommuting can be easily realized in only three steps

Ethernet to RS485 serial port counter WiFi module LED light controller ibf165
随机推荐
跳表的实现
MicTR01 Tester 开发套件(振弦采集读数仪)使用说明
Remember the common JS methods of projects
头条文章_signature
JS bidirectional linked list 01
flashfxp 530 User cannot log in. ftp
2021 Kent interview question 2
Paging query in applet
Knowledge points qwer
Summary of for loop in JS
Roson的Qt之旅#101 Qt Quick中的模型和视图
带你来浅聊一下!单商户功能模块汇总
Rust Getting Started Guide (crite Management)
为什么学编程的人大多数都去了深圳和北京?
Where is the RDS MySQL read-only instance of Alibaba cloud created
2021 Kent interview question 3
Zhaoqi scientific innovation and entrepreneurship competition platform, activity roadshow, investment and financing docking
js 链表 01
2021 肯特面试题3
深入理解Istio流量管理的熔断配置