mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 06:26:16 +00:00
add postgresql (#118)
This commit is contained in:
19
app/SSH/Services/Database/scripts/postgresql/backup.sh
Normal file
19
app/SSH/Services/Database/scripts/postgresql/backup.sh
Normal file
@ -0,0 +1,19 @@
|
||||
if ! sudo -u postgres pg_dump -d __database__ -f /var/lib/postgresql/__file__.sql; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! sudo mv /var/lib/postgresql/__file__.sql /home/vito/__file__.sql; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! sudo chown vito:vito /home/vito/__file__.sql; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! DEBIAN_FRONTEND=noninteractive zip __file__.zip __file__.sql; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
||||
|
||||
if ! rm __file__.sql; then
|
||||
echo 'VITO_SSH_ERROR' && exit 1
|
||||
fi
|
Reference in New Issue
Block a user