当前位置:网站首页>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 .
边栏推荐
- Deeply understand the fusing configuration of istio traffic management
- R语言ggplot2可视化绘制线图(line plot)、使用gghighlight包突出高亮线图中满足组合判断条件的线图(satisfies both condition A and B)
- 远距离串口服务器( 适配器)UART 转 1-Wire 应用
- Ask if you don't understand, and quickly become an advanced player of container service!
- R language uses ggpairs function of ggally package to visualize pairwise relationship graph of grouping multivariable, set alpha parameter to change image transparency, diagonal continuous variable de
- 食品安全 | 这两类瓜果宜改善便秘 孕妇人群尤其建议
- 百度编辑器ueditor,编辑内容过多时,工具栏不可见,不方便编辑或上传问题
- SCI scientific paper writing Growth Camp (full version)
- A tour of grp:05 - GRP server streaming service end stream
- Basic structure and operation principle of solar street lamp
猜你喜欢

Shell programming specifications and variables

How to measure the vibrating wire sensor by vibrating wire acquisition module?

带你来浅聊一下!单商户功能模块汇总

leetcode 题目

【微信小程序开发(七)】订阅消息

软件问题修复跟踪系统实战开发教程(上篇)

Food safety | these two kinds of melons and fruits should be improved, especially for pregnant women with constipation

Ask if you don't understand, and quickly become an advanced player of container service!

JS stack

头条文章_signature
随机推荐
太阳能路灯的根本结构及作业原理
【Multisim仿真】LM339过零电路仿真
Common problems and precautions of remote serial port server (adapter) uart/i2c/1-wire/spi PS304
Practical development tutorial of software problem repair tracking system (Part 1)
光学雨量计应用降雨量检测
Installation points and precautions of split angle probe
兆骑科创创新创业大赛人才引进平台,双创赛事高层次人才引进
Is MySQL query limit 1000,10 as fast as limit 10? If I want to page, what should I do?
JS array (summary)
How to measure the vibrating wire sensor by vibrating wire acquisition module?
A program for judging the result of cyclic input
【微信小程序开发(七)】订阅消息
Note: the value is rounded up to ten, hundred, thousand, ten thousand
Record Clearfix clear float
PHP mb_substr 中文乱码
Deeply understand the fusing configuration of istio traffic management
Voltage to current / current to voltage module
Zhengda cup hacker marathon data analysis competition
SCI scientific paper writing Growth Camp (full version)
2021 亚鸿笔试题2