Skip to content

A simple container, that maps a path, and deletes all old files, above a certain age

Notifications You must be signed in to change notification settings

rhjensen79/backup-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A simple container, that maps a path, and deletes all old files, above a certain age

Topics

Resources

Stars

Watchers

Forks