Automatically delete files from a few days agoWindows 2003 2008 Test PassesUse the Forfiles command to find data from a few days ago.Several parameters of Forfiles:/p is the path to the search. In our case, we're going to find the directory in which
FTP Server to save backup files, but also do not need to keep the data every day, so in order to consider saving hard disk space, you must delete some old files, as long as the last week or one months to save theWindows has a batch deletion program,
Operation Step Address: Http://wenku.baidu.com/link?url=_ Ddt7kztamwfc4ru1hms2tofb0p8us-wsxzqmccdt4k8-dp6vzcygz5mmu-rdms76efimpmgl9f0wqwd2s8uvux1u8_hkjkxdbcb4ikknumDelete files from three days agoforfiles/p i:\serverbak\2005/s/M * */d-2/"cmd/c del
Using the built-in commands under Windows2003 forfiles with scheduled tasks, you can automate the deletion of files from N days ago.It is easy to set the scheduled tasks for automatic execution in windows2003.First, script writingForfiles Command
forfiles/p e:/dbbackup/diff/s/M * */d-14/c "cmd/c del @file"Forfiles:The path specified by/p/s includes sub-directories/M Lookup filename Mask/d Specifies the date, with an absolute date and a relative date, where-7 refers to the current date 7 days
On the one hand, in order to facilitate the rapid restoration of the database, in addition to backup redundancy, Backup mode (first back to local, then tape), the database backup of several SQL SERVER 2000 in the hands, will be previously through
The next is the batch of the backup, added to the scheduled task, set the time to run automatically
Copy Code code as follows:
@echo off
REM Format Date
REM date is "2006-02-22 Wednesday" and cannot be used directly, so you
Forfiles
Select the file to be processed in batches from the folder or tree.
SyntaxForfiles [/p Path] [/m SearchMask] [/s] [/c Command] [/d [{+ |-}] [{MM/DD/YYYY | DD}]
Parameters/P PathSpecify Path to indicate where to start searching. The default
Why is the program running directory with registry setting on boot all system32?Wrote a program in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run to add the boot entry (normal work), but the egg hurt things happened, The
Log files are generated in the same directory after execution: the starting point of the DelExpiredLog.log reality execution.@echo offREM Write to logSet Filename=delexpiredlog.logEcho-------------------Delete Expired Log Files-----------------------
Forfiles
Select the file you want to batch from the folder or tree.
Grammar
forfiles [/P Path] [/M searchmask] [/s] [/C Command] [/d[{+ |-}] [{mm/dd/yyyy | DD}]]
Parameters
/P Path
Specify Path, indicating where to start the search. The default
forfiles [/P pathname] [/M searchmask] [/S]
[/C command] [/d [+ |-] {YYYY-MM-DD | dd}]
Describe:
Select a file (or a set of files) and on that file
Executes a command. This helps with batch jobs.
Parameter list:
/P pathname represents the path to
Forfiles
Select the file you want to batch from the folder or tree. Grammar
forfiles [/P Path] [/M searchmask] [/s] [/C Command] [/d[{+ |-}] [{mm/dd/yyyy | DD}]] Argument
/P Path
Specify Path, indicating where to start the search. The default folder
Sublime Text 3 provides build functionality that builds systems that can run an external command and capture output and display.To implement the compilation and operation of C or C + + code in sublime text 3, which is essentially a call to external
Ansible supports Windows from the 1.7+ version, with the actual measurement of Windows 7 SP1 and Windows Server R2 and above, the system is simply configured to communicate with Ansible normally. However, the following points need to be met:1, the
forfiles [/P pathname] [/M searchmask] [/S][/C command] [/d [+ |-] {YYYY/MM/DD | dd}]Describe:Select a file (or a set of files) and on that fileExecutes a command. This helps with batch jobs.Parameter list:/P pathname Indicates the path to start the
Note:1. If there is no forfiles.exe under XP, copy the Forfiles.exe file under Windows2003 to the System32 directory of XP to use the Forfiles command.2. This document applies to Windows client operating system XP Win7/8/10,windows server-side
Automatically delete SQL Server backup files for a specified date using Task SchedulerCommandforfiles [/P pathname] [/M searchmask] [/S][/C command] [/d [+ |-] {YYYY-MM-DD | dd}]Method 1:Description: You can delete a log file with a suffix of 7 days
One, set article:
1, set (no switch)
Set. =testSet.:: If a variable begins with: \. These three path-related symbols, you can omit a space by using set to view variables that begin with that character.Echo%tmp:*\=%:: Shows the part of the TMP
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.