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
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
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,
Using these parameters, we can construct the following example to solve the problem of deleting backup script files. You can create a script based on the modified date or backup type. You can even construct scripts that can reference both standards.
Windows forfiles (delete historical files) and Windows forfilesIntroduction
Forfiles is a batch DELETE command that comes with windows. It is a good option to determine the time by modifying the date attribute of the file itself and use it to delete
Although there are many ways to solve this problem, we can use T-SQL code to handle this file deletion process. I use the xp_cmdshell command and the Forfiles command to handle the process similar to what you have listed. Reliable information about
IntroductionForfiles is a batch delete command that comes with Windows, it is a good choice to judge the history file by using it to judge the time by the modification Date property of the file itself.Grammarforfiles [/P Path] [/M searchmask] [/s] [/
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
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
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.