forked from dan3805/dockserver-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backup.sh
27 lines (26 loc) · 1.05 KB
/
backup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
##################################
# Copyright (c) 2021, : MrDoob #
# Docker owner : doob187 #
# Docker Maintainer : doob187 #
# Code owner : doob187 #
# All rights reserved #
##################################
# THIS DOCKER IS UNDER LICENSE #
# NO CUSTOMIZING IS ALLOWED #
# NO REBRANDING IS ALLOWED #
# NO CODE MIRRORING IS ALLOWED #
##################################
# shellcheck disable=SC2086
# shellcheck disable=SC2006
$(command -v docker) system prune -af 1>/dev/null 2>&1
$(command -v docker) pull ghcr.io/dockserver/docker-backup:latest 1>/dev/null 2>&1
dock=$(docker ps -aq --format '{{.Names}}' | grep -v 'trae' | grep -v 'auth' | grep -v 'cf')
for i in ${dock}; do
$(command -v docker) run --rm -v /opt/appdata:/backup/$i -v /mnt:/mnt ghcr.io/dockserver/docker-backup:latest backup $i local
$(command -v chown) -cR 1000:1000 /mnt/downloads/appbackups/local/$i.tar.gz 1>/dev/null 2>&1
done
$(command -v docker) system prune -af 1>/dev/null 2>&1
exit
#EOF