#! /bin/bash

# vaultwarden
docker stop vaultwarden
tar zcf /home/acedanger/backup/docker-data/vaultwarden-data-bk-`date +%Y%m%d`.tar.gz  /var/lib/docker/volumes/vaultwarden_data/_data
docker start vaultwarden

# paperless
#docker stop paperless-ng_broker_1 paperless-ng_db_1 paperless-ng_webserver_1
#tar zcf /home/acedanger/backup/docker-data/paperless-data-bk-`date +%Y%m%d`.tar.gz /var/lib/docker/volumes/paperless-ng_data/_data
#tar zcf /home/acedanger/backup/docker-data/paperless-media-bk-`date +%Y%m%d`.tar.gz /var/lib/docker/volumes/paperless-ng_media/_data
#tar zcf /home/acedanger/backup/docker-data/paperless-pgdata-bk-`date +%Y%m%d`.tar.gz /var/lib/docker/volumes/paperless-ng_pgdata/_data
#docker start paperless-ng_broker_1 paperless-ng_db_1 paperless-ng_webserver_1

# uptime-kuma
docker stop uptime-kuma
tar zcf /home/acedanger/backup/docker-data/uptime-kuma-data-bk-`date +%Y%m%d`.tar.gz /var/lib/docker/volumes/uptime-kuma/_data
docker start uptime-kuma

# send a notification to https://notify.peterwood.rocks\lab
curl \
  -H priority:default \
  -H tags:backup,docker,vaultwarden,uptime-kuma,${HOSTNAME} \
  -d "Completed backup of vaultwarden, uptime-kuma" \
  https://notify.peterwood.rocks/lab
