In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Description
Use the task schedule to execute batch files at a specified time every day
1. Realize automatic Copy database backup files to another host
2. Automatically delete backup files for a specified number of days
1. Batch file code CopyDB2Lan (factory). Bat
* the beginning of the code *
@ echo off
Color 0e
Cls
Title Copy DB to the mirror host (by XX@163.com).
Set desthost=\\ 172.32.4.252\ SfisBackup
Set lc=y:
Set work_path=D:\ SfisBackup
Set stg_name=D:\ SfisBackup\ stg_123456.txt
Set pskip=4
Net use lc% desthost% "P@ssword" / user:administrator
For / r work_path% I in (sfis*.bak) do echo I > > stg_name%
For / f "skip=%pskip%" I in (% stg_name%) do set cpfilename=%%i
Copy cpfilename% lc% / y
If exist stg_name% del / Q stg_name%
Net use lc% / del
* end of code *
2. Batch file code CleanOldDB.bat
* end of code *
@ echo off
Lolor @ e
Cls
Title deletes files from N days ago (by XX@163.com).
Set work_path=D:\ SfisBackup
Set stg_name=D:\ SfisBackup\ stg_123456.txt
Set dd=10
Forfiles / p "% work_path%" / s / m *. * / d -% dd% / c "cmd / c del / Q @ path"
Pause
* end of code *
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.