Skip to content

About

This project is used as a 'sidecar' in all statefull sets

Resources

Stars

0 stars

Watchers

6 watching

Forks

Repository files navigation

Garbage cleaner docker image

This project is used as a 'side car' in all statefull sets.

Purges old files from a list of folders. Deletes all files not accessed for a specific time period.

(Used timing in minutes)

Usage:

    docker run \
        --env "PURGE_FOLDERS=cache,/assets" \
        --env "LOG_FOLDERS="/data/logs" \
        --env "FILE_AGE=2" \
        --env "CRON_MOVELOGS=*/5 * * * *" \
        --env "CRON_PURGE=0 3 * * *" \
        garbage-cleaner

Also, it will clean up logs in /data/logs

PURGE_FOLDERS

A comma separated list of <folder>[:<file criteria>[:<directory criteria>]].

<file criteria>

find arguments selecting the files to delete. Defaults to -atime +30.

<directory criteria>

find arguments selecting the empty directories to delete. Defaults to the first two words of <file criteria>, with atime/amin replaced by mtime/mmin.

E.g. delete everything in a camel input folder older than a year, except a config file, and only remove empty directories inside the .camel archives (so that the input directories themselves are kept):

/data/input:-mtime +365 ! -name config.properties:-mtime +365 -path */.camel/*

About

This project is used as a 'sidecar' in all statefull sets

Resources

Stars

0 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages