restart on fail, clear old backups

master
bel 2020-12-05 11:36:36 -07:00
parent 16b974afd1
commit 9182e656bf
3 changed files with 10 additions and 5 deletions

View File

@ -16,7 +16,7 @@ RUN export DEBIAN_FRONTEND=noninteractive; \
cron \ cron \
postgresql postgresql-contrib \ postgresql postgresql-contrib \
&& curl -L \ && curl -L \
https://github.com/miniflux/miniflux/releases/download/2.0.21/miniflux_2.0.21_amd64.deb \ https://github.com/miniflux/miniflux/releases/download/2.0.25/miniflux_2.0.25_amd64.deb \
> /miniflux.deb \ > /miniflux.deb \
&& dpkg -i /miniflux.deb \ && dpkg -i /miniflux.deb \
&& mkdir -p /mnt/save && mkdir -p /mnt/save
@ -56,5 +56,5 @@ ENTRYPOINT \
&& bash /restore.sh \ && bash /restore.sh \
&& miniflux -migrate \ && miniflux -migrate \
&& miniflux -create-admin \ && miniflux -create-admin \
&& miniflux \ && (while true; do miniflux; sleep 1; done) \
& exec /pauser & exec /pauser

View File

@ -1,4 +1,9 @@
for b in $(find /mnt/save -not -path '*/\.*' -type f | sort -r); do all_backups=($(find /mnt/save -not -path '*/\.*' -type f | sort -r))
for ((i=${#all_backups[@]}-1; i>50; i--)); do
echo rm old backpu ${all_backups[i]} >&2
done
for b in "${all_backups[@]}"; do
if [ -n "$b" ]; then if [ -n "$b" ]; then
du -sh "$b" du -sh "$b"
if ! du -sh "$b" | grep -Ei "^[ \t]*[0-9][0-9]*[0-9]?(.0)?[mg]"; then if ! du -sh "$b" | grep -Ei "^[ \t]*[0-9][0-9]*[0-9]?(.0)?[mg]"; then