idun/Readme.md

134 lines
3.3 KiB
Markdown
Raw Normal View History

2023-10-12 08:20:53 +00:00
# Idun
![Image of Idum](Idun.jpg)
A small CLI Tool to clean Backups from different Sources. Based on Rules Idun delete Backup files that are older but keep 1 per hour, per day, per weak or month.
## Buckets
Based on the age of a Backup the Backups will be sorted in one Bucket and based on the Rules of that Bucket will be deleted or keep the Backup.
### Unlimit Bucket (config per Hour)
Keep every Backup
You can configure that for the first X Hour of a Backup livetime. The number of hours is the **minimum** Hours Idun keep the Backups
### Hourly Bucket (config per Hour)
Will keep one Backup per Hour. One Hour is from Min 0 to Min 59, it will keep the olders Backup. If you make Backups at XX:00, XX:15, XX:30 and XX:45 it will keep the Backup at XX:45.
### Daily Backup (config per Day)
2023-10-12 09:29:49 +00:00
Will keep one Backup per Day. One Day is from 00:00:00 UTC to 23:59:59, it also will keep the olders Backup, tha backup closed to 23:59:59 will stay, all newer Backup at that day will be removed.
2023-10-12 08:20:53 +00:00
### Weekly Backup (config per Month)buc
### Monthly Backups (config per Month)
### Delete All
Delete all Backups in this Bucket, used at the end to remove all really old (based on the rules) backups
2023-10-12 11:09:22 +00:00
## Backends
### Locale Filesystem
Config parameter:
* path: Path to the folder on the Filesystem
### SFTP (alpha)
2023-10-14 13:07:58 +00:00
issues:
* Currenlty just with username/password
* untestet
2023-10-12 11:09:22 +00:00
Config parameter:
* path: Path to the folder on the Filesystem
* username: Username
* password: Password
* addr: Server and Port (server:port)
2023-10-14 13:07:58 +00:00
### S3
issues:
* untestet
Config Parameter:
2023-10-14 13:13:04 +00:00
* prefix: Path/S3 Prefix to the Backups
* keyid: API Key Id
* secret: API Key Secret
* bucket: Name of the bucket
* endpoint: Endpoint
* region: Region
2023-10-14 13:07:58 +00:00
2023-10-12 11:09:22 +00:00
2023-10-12 08:20:53 +00:00
## Config
2023-10-12 10:47:35 +00:00
```
---
timezone: Europe/Berlin
jobs:
- name: abc
driver: LocaleFileSystem
buckets:
daily: 3
monthly: 12
hourly: 130
config:
path: /tmp/idun-test
- name: abc2
driver: LocaleFileSystem
buckets:
hourly: 12
config:
path: /tmp/idun-test
- name: name
driver: sftp
buckets:
monthly: 12
weekly: 3
daily: 3
hourly: 24
unlimit: 0
config:
path: /backup
username: USERNAME
password: PASSWORD
addr: SERVER:PORT
```
2023-10-12 08:20:53 +00:00
## Usage
### Show Plan
You can see the Plan to check if the config is what you are expected.
```
idun plan -job abc2
```
The job argument is optional and can be used to show just the plan of on job based on the "name" in the config.
### Dry-Run
Show all fieles
```
idun dry-run -job abc2
```
2023-10-12 09:29:49 +00:00
The job argument is optional and can be used to show just the plan of on job based on the "name" in the config.
2023-10-12 08:20:53 +00:00
### Execute
2023-10-12 09:29:49 +00:00
Execute the deletion, will ask before deleting the files
```
idun execute -job abc2
```
The job argument is optional and can be used to show just the plan of on job based on the "name" in the config.
2023-10-12 08:20:53 +00:00
2023-10-12 09:29:49 +00:00
### Cron run
2023-10-12 08:20:53 +00:00
## FAQ
### Why minimum Hour/Day/Month
If you configure to keep one backup per hour for 12 hours Idun will make sure there will be hourly backups for at least 12 hours. But based on the rules of the next Buckets, which is per Day from 00:00:00 UTC to 23:59:59 UTC there may be a gap between the end hour of the "Hourly Bucket" and the beginn of the "Daily Bucket", in this case Iduna will not delete the Backup files. So ther will be up to 35 Hours Hourly Backups.