diff --git a/README.md b/README.md index dd63235..e401592 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,35 @@ Delete dated files in a directory according to a time period config. Useful for backup directories that accumulate files over time. + +## Example config +```toml +# Specify a folder containing backups +path = "/backups/docker" + +# uncomment if the backups are btrfs subvolumes +#btrfs = true + +[[periods]] +# For the first day, keep one backup per second (basically, don't delete backups) +# syntax supports suffixes s, m, h, d, w +period_length = "1d" +chunk_size = "1s" + +[[periods]] +# For the next week, keep one backup per hour +period_length = "1w" +chunk_size = "1h" + +[[periods]] +# For the next 4 weeks, keep one backup per day +period_length = "4w" +chunk_size = "1d" + +# can add more [[periods]] as needed +``` + +## Example usage +```sh +filereap --help +``` diff --git a/example.toml b/example.toml index 24ce146..f6d41ab 100644 --- a/example.toml +++ b/example.toml @@ -1,18 +1,23 @@ -path = "./test" +# Specify a folder containing backups +path = "/backups/docker" + +# uncomment if the backups are btrfs subvolumes #btrfs = true [[periods]] -period_length = "10m" +# For the first day, keep one backup per second (basically, don't delete backups) +# syntax supports suffixes s, m, h, d, w +period_length = "1d" chunk_size = "1s" [[periods]] +# For the next week, keep one backup per hour period_length = "1w" chunk_size = "1h" [[periods]] +# For the next 4 weeks, keep one backup per day period_length = "4w" chunk_size = "1d" -[[periods]] -period_length = "40w" -chunk_size = "4w" +# can add more [[periods]] as needed