Skip to content

Script to delete all or last modified cach file in the localapp data path

Notifications You must be signed in to change notification settings

DenisFri/MPruner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPruner

Introduction

MPruner is a script designed to clean up cached files. It allows you to specify a target directory and choose whether to delete all files or only the last modified file in the directory. The operation results, including any errors encountered, are logged to a log file. Multiple directories can be configured for cleaning.

Features

  • Configurable Path: Define the target directory through a configuration file.
  • Multiple Directories: Configure multiple directories for cleaning.
  • Selective Deletion: Choose to delete all files or only the last modified file in the directory.
  • Logging: Logs the operation results, including any errors encountered, to a log file.

Requirements

  • Go 1.23.0 or later

Setup

1. Clone the Repository

Clone the repository to your local machine.

git clone https://github.com/DenisFri/MissionCachePruner.git
cd mpruner

2. Configuration

In case the default configuration file is missing, create a new config.json by copying the provided template.

{
  "directories": [
    {
      "path": "Mention\\Your\\Directory\\Here",
      "delete_all": false
    },
    {
      "path": "Mention\\Your\\Second\\Directory\\Here",
      "delete_all": false
    }
  ]
}

3. Build

To build the Go script into an executable, run:

go build -o mpruner.exe main.go

4. Run

To run the program, use:

./mpruner.exe

Logging

MPruner logs all its operations to cleanup.log. The log file records:

  • Expanded directory paths.
  • Successful or failed attempts to delete files.
  • Information about skipping duplicate directories.
  • Any errors encountered during the process.

About

Script to delete all or last modified cach file in the localapp data path

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages