Skip to content

Latest commit

 

History

History
57 lines (35 loc) · 1.55 KB

README.md

File metadata and controls

57 lines (35 loc) · 1.55 KB

Backup Cleaner

Table of Contents

About

This project delivers a container, that can be started and mapped to a path, where it deletes all files older than x amount of days, to cleanup old backup files. It's setup to only take files starting with backup, and ending with tar.gz. The idea come from a Docker backup project, I have been using, where I found the cleanup solution not working in my setup.

Getting Started

Prerequisites

to use this project, you need to have Docker installed to be able to run the container.

Installing

Use it by running the folling, where LOCALSHARE is the folder and subfolders you want to have cleaned.

docker run --rm -v LOCALSHARE:/data -e DAYS_TRESHOLD='7' ghcr.io/rhjensen79/backup-cleaner:latest

Usage

I'm using Cronincle schelduler to run my container, using this project but it's not limited to that.

It could also be run using a simpel Cron task.

Testing

There is a makefile, you can use to build and test the container.

make build

Builds the container

make run

Runs the container, and maps it to ./dummy_folder

make test

Builds the container, runs a test script, to create 100 dumy files, and then runs the container, to remove all the files again. Usefull for testing.