chore: use monorepo organization
This commit is contained in:
parent
deaf7d6ecc
commit
a687827f7e
1099 changed files with 8184 additions and 11535 deletions
17
packages/server/bin/lamassu-backup-pg
Executable file
17
packages/server/bin/lamassu-backup-pg
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ "$(whoami)" != "root" ]; then
|
||||
echo -e "This script has to be run as \033[1mroot\033[0m user"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
DAYS_TO_KEEP=3
|
||||
DATE=$(date --utc +%F_%H-%M)
|
||||
BACKUP_DIR=/var/backups/postgresql
|
||||
BACKUP_FILE=$BACKUP_DIR/backup-$DATE.sql.gz
|
||||
|
||||
cd ~postgres
|
||||
su postgres -c "pg_dump lamassu" | gzip > $BACKUP_FILE
|
||||
cd
|
||||
find $BACKUP_DIR -maxdepth 1 -mtime +$DAYS_TO_KEEP -exec rm -f '{}' ';'
|
||||
Loading…
Add table
Add a link
Reference in a new issue