Delete backup files from the previous two days-usage of the forfiles command

Source: Internet
Author: User

F: \ autorun \ delsqlbackup> forfiles/P "Z: \ mysqlback "/D-2/C" CMD/C if @ isdir = true echo deleting @ file & RD/Q/s @ path"

 

/C command indicates the Command executed for each file. The command string should
Enclosed in double quotation marks.

The default command is "CMD/C echo @ File ". The following variables
It can be used in command strings:
@ File-the returned file name.
@ Fname-return the file name without the extension.
@ Ext-only returns the extension of the file.
@ Path-returns the complete path of the object.
@ Relpath-the relative path of the returned file.
@ Isdir-if the file type is directory, "true" is returned ";
If it is a file, "false" is returned ".
@ Fsize-returns the file size in bytes.
@ Fdate-returns the last modification date of the file.
@ Ftime-the last modification time of the returned object.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.