Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yaroslaff/storagebox-expire

Manage backups on remote storagebox (e.g. hetzner). Delete expired backups.
https://github.com/yaroslaff/storagebox-expire

Last synced: 5 days ago
JSON representation

Manage backups on remote storagebox (e.g. hetzner). Delete expired backups.

Awesome Lists containing this project

README

        

# storagebox-expire
Manage backups on remote storagebox (e.g. hetzner). Delete expired backups.

## List backups
~~~shell
$ storagebox-expire.py uNNNNNN.your-storagebox.de -p 23 -u uNNNNN --list
2022-08-29 16:50 started
Daily:
d5s-2022-08-29.tar.gz: d5s 2022-08-29 00:00:00
liste-2022-08-29.tar.gz: liste 2022-08-29 00:00:00
signal-2022-08-29.tar.gz: signal 2022-08-29 00:00:00

Monthly:
d5s-2022-07-22.tar.gz: d5s 2022-07-22 00:00:00
liste-2022-08-29.tar.gz: liste 2022-08-29 00:00:00
signal-2022-08-29.tar.gz: signal 2022-08-29 00:00:00

~~~

## Create monthly backups
~~~shell
$ storagebox-expire.py uNNNNNN.your-storagebox.de -p 23 -u uNNNNN --mkmonthly
2022-08-29 16:45 started
Daily:
d5s-2022-08-29.tar.gz: d5s 2022-08-29 00:00:00
liste-2022-08-29.tar.gz: liste 2022-08-29 00:00:00
signal-2022-08-29.tar.gz: signal 2022-08-29 00:00:00

Monthly:
d5s-2022-07-22.tar.gz: d5s 2022-07-22 00:00:00
liste-2022-08-29.tar.gz: liste 2022-08-29 00:00:00

UPDATE /home/daily/signal-2022-08-29.tar.gz /home/monthly
Copied 1 backups
~~~

## Delete expired backups
~~~shell
$ storagebox-expire.py uNNNNNN.your-storagebox.de -p 23 -u uNNNNN --expire 35
2022-08-29 17:17 started
=== d5s
DELETE /home/daily/d5s-2022-07-21.tar.gz
DELETE /home/daily/d5s-2022-07-22.tar.gz
DELETE /home/daily/d5s-2022-07-23.tar.gz
DELETE /home/daily/d5s-2022-07-24.tar.gz
=== liste
DELETE /home/daily/liste-2022-07-20.tar.gz
DELETE /home/daily/liste-2022-07-21.tar.gz
DELETE /home/daily/liste-2022-07-22.tar.gz
DELETE /home/daily/liste-2022-07-23.tar.gz
DELETE /home/daily/liste-2022-07-24.tar.gz

...
~~~

## Cron
`/etc/cron.d/storagebox`:
~~~
5 8 * * * root /usr/local/bin/storagebox-expire.py uNNNNNN.your-storagebox.de -p 23 -u uNNNNNN --mkmonthly
10 8 * * * root /usr/local/bin/storagebox-expire.py uNNNNNN.your-storagebox.de -p 23 -u uNNNNNN --expire 30
~~~