使用Winrar压缩工具特性,执行后相当于被删的文件被移到了压缩包里,如不想再要了,就删压缩包.RAR就行了,如果误删,还可解压恢复。
关于上面指令已测试通过,下面给出Winrar的参数解释, RAR.EXE /? 有更详帮助:)
(注:我将WinRAR压缩工具目录内的 rar.exe 直接copy到了 windows 目录中,调用的时候方便,懒得再修改环境PATH信息:)
ta<日期> 处理在以 YYYYMMDDHHMMSS 格式描述的 <日期> 之后修改的文件
tb<日期> 处理在以 YYYYMMDDHHMMSS 格式描述的 <日期> 之前修改的文件
(注意:指这日期以前文件,不包括指定的日期本天,所以日期要加1)
m<0..5> 设置压缩等级 (0-存储...3-默认...5-最大)
(注:使用 /M0 参数,因为压缩的过程就是删的过程,/M0是不压只存,所以速度快)
df 生成压缩档案后删除文件
(注:就是压缩以后就把源文件直接删掉了,起到间接删目录中不需要的文件作用)
r 包含所有子目录
(注: /R 参数是压缩指定目录下的所有目录中的文件)
……
Using the characteristics of the WinRAR compression tool, after execution, the deleted file is equivalent to being moved into the compressed package. If you don't want it anymore, just delete the compressed package.RAR. If you mistakenly delete it, you can also extract and recover it.
The above instruction has been tested and passed. The following gives the parameter explanation of WinRAR. RAR.EXE /? has more detailed help: )
(Note: I directly copied the rar.exe in the WinRAR compression tool directory to the windows directory for convenient calling, and I'm too lazy to modify the environment PATH information: )
ta<date> Process files modified after the <date> described in YYYYMMDDHHMMSS format
tb<date> Process files modified before the <date> described in YYYYMMDDHHMMSS format
(Note: Refers to files before this date, not including the specified date of the day, so the date should be added by 1)
m<0..5> Set compression level (0-storage...3-default...5-max)
(Note: Use /M0 parameter, because the compression process is the deletion process, /M0 is no compression but only storage, so the speed is fast)
df Delete files after generating the compressed archive
(Note: That is, after compression, the source file is directly deleted, which plays the role of indirectly deleting unnecessary files in the directory)
r Include all subdirectories
(Note: The /R parameter is to compress the files in all directories under the specified directory)
……