Delete log files longer than 45 days
来源:互联网 发布:windows无法与dns通信 编辑:程序博客网 时间:2024/05/18 01:46
$DirectoryFiles = "D:\LogFiles"$FilesOlderThan = 45$DeletedFiles = 0$FilesNotDeleted = 0$TempFiles = Get-ChildItem $DirectoryFiles -RecurseIf ($TempFiles -ne $null) { foreach ($Files2Delete in $TempFiles) { $FileAge = ((Get-Date) - $Files2Delete.LastWriteTimeUtc).Days If ($FileAge -ge $FilesOlderThan -and $Files2Delete.PsISContainer -ne $True) { $Files2Delete.Delete() $DeletedFiles = $DeletedFiles + 1 } Else { $FilesNotDeleted = $FilesNotDeleted + 1}} } Else { }
0 0
- Delete log files longer than 45 days
- Delete Files Older Than x Days on Linux
- Linux Bash script to remove files older than 3 days
- Backup / delete event log files
- Batch script to delete file older than N days
- How to Delete [This is no longer located in Directory] Files
- How To Delete Archive Log Files Out Of +Asm
- delete files
- Find another way longer than A-C
- Log of these two days
- delete log
- UTF8 encoding is longer than the max length 32766
- [Python] openpyxl读存大数据 Exception: String longer than 32767 characters
- Field XXXX input value is longer than screen field-BDC
- java read delete files
- Delete untracked files
- Oracle log files
- URAL 2073. Log Files
- Laravel课程表的数据库设计与实现
- apache httpcompontens之HttpAsyncClient使用
- mac 开发环境配置之homebrew
- android项目打包成jar
- HorizontalListView 横向listview
- Delete log files longer than 45 days
- 实用微博链接
- 15.4.1 杠杆利用类型参数推断
- 1153 - Paquet plus grand que 'max_allowed_packet' (navicat)
- oracle 触发器的实例
- 数据库表分割技术浅析(水平分割/垂直分割/库表散列)
- Apache2.4.9本地访问正常但是在局域网或外网IP拒绝访问
- java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView
- centos forever node 开机自启动