forked from ticketfrei/ticketfrei
Created a borgbackup script for deployments with nginx & uwsgi
This commit is contained in:
parent
87c263cb3f
commit
2ca213d88a
11
README.md
11
README.md
|
@ -178,6 +178,17 @@ sudo systemctl daemon-reload
|
||||||
sudo systemctl start ticketfrei-backend.service
|
sudo systemctl start ticketfrei-backend.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Backup
|
||||||
|
|
||||||
|
For automated backups, you need to backup these files:
|
||||||
|
|
||||||
|
* `/var/ticketfrei/db.sqlite`
|
||||||
|
* `/srv/ticketfrei/config.toml`
|
||||||
|
* `/etc/aliases`
|
||||||
|
|
||||||
|
You can find an example how to do this with borgbackup in the deployment
|
||||||
|
folder. Adjust it to your needs.
|
||||||
|
|
||||||
### Logs
|
### Logs
|
||||||
|
|
||||||
There are several logfiles which you can look at:
|
There are several logfiles which you can look at:
|
||||||
|
|
21
deployment/backup.sh
Normal file
21
deployment/backup.sh
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# This is a script to backup the necessary components for a deployment with
|
||||||
|
# nginx and uwsgi with borgbackup.
|
||||||
|
|
||||||
|
# stop the services
|
||||||
|
service ticketfrei-web stop
|
||||||
|
service ticketfrei-backend stop
|
||||||
|
|
||||||
|
# export repository passphrase
|
||||||
|
export BORG_PASSPHRASE='password'
|
||||||
|
|
||||||
|
# create backup
|
||||||
|
borg create --stats --progress backup:repositories-borg/ticketfrei::'backup{now:%Y%m%d}' /etc/aliases /var/ticketfrei/db.sqlite /srv/ticketfrei/config.toml
|
||||||
|
|
||||||
|
# restart the service
|
||||||
|
service ticketfrei-backend start
|
||||||
|
service ticketfrei-web start
|
||||||
|
|
||||||
|
# prune outdated backups to save storage
|
||||||
|
borg prune --keep-daily=7 --keep-weekly=4 backup:repositories-borg/ticketfrei
|
||||||
|
|
Loading…
Reference in a new issue