Windows Linux 删除N天之前的文件脚本

简介:                              Windows Linux 删除N天之前的文件脚本    通常做为备份服务器经常会存放非常多的历史文件,而这些文件又并非需要长期而永久的保存,只需保存备份后恢复所需的文件,这个时候就需要定期删除过期而无效的备份文件。
                             Windows Linux 删除N天之前的文件脚本




   通常做为备份服务器经常会存放非常多的历史文件,而这些文件又并非需要长期而永久的保存,只需保存备份后恢复所需的文件,这个时候就需要定期删除过期而无效的备份文件。


Windows 下删除方式如下:
forfiles /p d:\OraBackups\prudenwoo /m * /d -7 /c "cmd /c del @file"  
forfiles /p d:\OraBackups\prudenwoo /m * /d -7 /c "cmd /c del @file"  








Linux 下删除方式如下


语法如下:
find 对应目录 -mtime +天数 -name "文件名" -exec rm -rf {} \;


示例:
find /OraBackups/ -mtime +7 -name "*.bak" -exec rm -rf {} \;

目录
相关文章
|
9月前
|
安全 Linux 生物认证
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
361 0
Nexpose 8.25.0 for Linux & Windows - 漏洞扫描
|
9月前
|
安全 Linux iOS开发
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
777 53
Binary Ninja 5.1.8104 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
9月前
|
安全 Linux 生物认证
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
419 17
Nexpose 8.24.0 for Linux & Windows - 漏洞扫描
|
9月前
|
Linux API iOS开发
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
685 14
Binary Ninja 4.2.6455 (macOS, Linux, Windows) - 反编译器、反汇编器、调试器和二进制分析平台
|
9月前
|
SQL 安全 Linux
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
451 1
Metasploit Pro 4.22.8-20251014 (Linux, Windows) - 专业渗透测试框架
|
9月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
1039 1
Metasploit Framework 6.4.95 (macOS, Linux, Windows) - 开源渗透测试框架
|
10月前
|
安全 Linux 网络安全
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
521 2
Metasploit Pro 4.22.8-2025091701 (Linux, Windows) - 专业渗透测试框架
|
10月前
|
JSON 安全 Linux
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
317 1
Nexpose 8.22.0 for Linux & Windows - 漏洞扫描
|
10月前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
591 1
Metasploit Framework 6.4.90 (macOS, Linux, Windows) - 开源渗透测试框架
|
10月前
|
安全 Ubuntu Linux
Nexpose 8.21.0 for Linux & Windows - 漏洞扫描
Nexpose 8.21.0 for Linux & Windows - 漏洞扫描
251 4
Nexpose 8.21.0 for Linux & Windows - 漏洞扫描