archive
This commit is contained in:
14
kanboard/kanboarddocker/backup.sh
Normal file
14
kanboard/kanboarddocker/backup.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#! /bin/bash
|
||||
|
||||
date
|
||||
mkdir -p /mnt/save
|
||||
d=/mnt/save/$(date +%Y-%m-%d-%H-%M-%S).dump
|
||||
echo backing up as $d...
|
||||
pg_dump $DATABASE_URL --clean \
|
||||
> $d \
|
||||
|| rm -f $d
|
||||
total=$(ls /mnt/save/* | wc -l)
|
||||
to_del=$((total-${BACKUPS:-10}))
|
||||
if ((to_del>0)); then
|
||||
rm -f $(ls /mnt/save/* | head -n $to_del)
|
||||
fi
|
||||
Reference in New Issue
Block a user