开发者

C# Utility to Delete Periodically Aged Files [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

开发者_C百科 Improve this question

Any recommendation on a C# utility (open source) that can can cleanup/delete aged files. Ideally runs as a service.


Here's a Powershell script that I run as a scheduled task:

dir c:\directory-to-watch | where {$_.LastWriteTime -lt
    [DateTime]::Today.AddDays(-7)} | del

Delete all files not touched in the last seven days from c:\directory-to-watch.


We use xxcopy scripts that we create and that are executed from task scheduler as Forgotten Semicolon mentions above.

Checkout their command line reference. Their utility is extremely useful and flexible.

http://www.xxcopy.com/xxcopy01.htm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜