mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-16 18:50:13 +00:00
fix scripts to reduce disk writes
This commit is contained in:
parent
df69aa048a
commit
c9667036b3
1 changed files with 21 additions and 0 deletions
21
cron.sh
Normal file
21
cron.sh
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
opts=$1
|
||||
rclone_db(){
|
||||
FILENAME=pluralkit-$(date -u +"%Y-%m-%dT%H:%M:%S").sql.gz
|
||||
dump_db | gzip | rclone rcat $2/$FILENAME
|
||||
}
|
||||
|
||||
dump_db(){
|
||||
docker-compose -f "$(dirname $0)/../docker-compose.yml" exec -T -u postgres db pg_dump postgres
|
||||
}
|
||||
|
||||
|
||||
usage(){
|
||||
docker-compose -f "$(dirname $0)/../docker-compose.yml" exec -T -u postgres db pg_dump postgres
|
||||
}
|
||||
|
||||
case $opts in
|
||||
rclone_db) rclone_db;;
|
||||
dump_db) dump_db ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue