Compare commits
3 Commits
e017320e8c
...
master
Author | SHA1 | Date | |
---|---|---|---|
f3f9b8179a | |||
6ca58e0ece | |||
5cbfdf0442 |
3
asgard/ingress-nginx.md
Normal file
3
asgard/ingress-nginx.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# [asgard] Install ingress-nginx
|
||||||
|
|
||||||
|
`kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.1/deploy/static/provider/baremetal/deploy.yaml`
|
@ -7,7 +7,7 @@ DATABASES=''
|
|||||||
BACKUP_DIR=/data/backup/postgresql
|
BACKUP_DIR=/data/backup/postgresql
|
||||||
RETENTION_DAYS=7
|
RETENTION_DAYS=7
|
||||||
|
|
||||||
if ! source /etc/mkpsqlbackup.conf ; then
|
if ! . /etc/mkpsqlbackup.conf ; then
|
||||||
echo '[MKPSQLBACKUP] : Unable to load configuration file' >&2
|
echo '[MKPSQLBACKUP] : Unable to load configuration file' >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -17,14 +17,14 @@ if [ "$(id -un)" != 'postgres' ] ; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FINAL_BACKUP_DIR="$BACKUP_DIR/-$(date '+%Y-%m-%d')"
|
FINAL_BACKUP_DIR="$BACKUP_DIR/$(date '+%Y-%m-%d')"
|
||||||
echo "[MKPSQLBACKUP] : Creating backup directory $FINAL_BACKUP_DIR"
|
echo "[MKPSQLBACKUP] : Creating backup directory $FINAL_BACKUP_DIR"
|
||||||
if ! mkdir -p "$FINAL_BACKUP_DIR" ; then
|
if ! mkdir -p "$FINAL_BACKUP_DIR" ; then
|
||||||
echo "[MKPSQLBACKUP] : Unable to create backup directory $FINAL_BACKUP_DIR"
|
echo "[MKPSQLBACKUP] : Unable to create backup directory $FINAL_BACKUP_DIR"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for db in DATABASES ; do
|
for db in $DATABASES ; do
|
||||||
echo "[MKPSQLBACKUP] : Backup of $db"
|
echo "[MKPSQLBACKUP] : Backup of $db"
|
||||||
if ! pg_dump -Fc "$db" -f "$FINAL_BACKUP_DIR/$db" ; then
|
if ! pg_dump -Fc "$db" -f "$FINAL_BACKUP_DIR/$db" ; then
|
||||||
echo "[MKPSQLBACKUP] : Unable to backup database $db" >&2
|
echo "[MKPSQLBACKUP] : Unable to backup database $db" >&2
|
||||||
@ -32,4 +32,4 @@ for db in DATABASES ; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo '[MKPSQLBACKUP] : Purging old backups'
|
echo '[MKPSQLBACKUP] : Purging old backups'
|
||||||
find "$BACKUP_DIR" -maxdepth 1 mindepth 1 -mtime +"$RETENTION_DAYS" -exec rm -rf '{}' ';'
|
find "$BACKUP_DIR" -maxdepth 1 -mindepth 1 -mtime +"$RETENTION_DAYS" -exec rm -rf '{}' ';'
|
||||||
|
@ -2,4 +2,6 @@
|
|||||||
Description=Performing PostgreSQL database backups
|
Description=Performing PostgreSQL database backups
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
User=postgres
|
||||||
|
Group=postgres
|
||||||
ExecStart=/usr/local/bin/mkpsqlbackup
|
ExecStart=/usr/local/bin/mkpsqlbackup
|
||||||
|
Reference in New Issue
Block a user