[go: up one dir, main page]

Skip to content

The folder cleanup service enables to automatically cleanup user defined folders of old files.

License

Notifications You must be signed in to change notification settings

daniel-leinweber/folder-cleanup-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

folder-cleanup-service

The folder cleanup service enables to automatically cleanup user defined folders of old files.

It is possible to define multiple folders for cleanup. Each folder can define its own maximum days until a file should be deleted. Furthermore each folder can define, if the files should be deleted in two steps or directly.

Motivation

I created this service to cleanup my ever growing downloads folder automatically.

Technologies used

  • C#
  • .NET Core 3.1
  • Worker Service (Microsoft.Extensions.Hosting.BackgroundService)

How to use

The service can be installed as a Windows Service. For further information please visit: Microsoft Docs

Service configuration

You can change the appsettings.json file to configure multiple folders for cleanup and to configure the interval of the service execution.

Add your folder objects in the section Folders.

"Folders": 
[
    {
        "Path": "C:\\Users\\DL\\Downloads",
        "MaximumFileAgeInDays": 7,
        "UseRecycleBin": true,
        "Recursive": true
    }
]
  • Path will be the full path of the folder to cleanup
  • MaximumFileAgeInDays should be the number of days a file is allowed to live in the specified folder
  • UseRecycleBin is used to specify if the files should be moved into the systems recycle bin, or if they should be deleted immediately
  • Recursive can be used to determine, if sub folders will also be processed

Change the IntervalInMilliseconds in the section Service to your needs.

About

The folder cleanup service enables to automatically cleanup user defined folders of old files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages