Created
February 14, 2025 17:11
-
-
Save iamnimnul/0a9f943823d0256dc14664d7f6a24377 to your computer and use it in GitHub Desktop.
uptime kuma - run docker script & backup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
set -euxo pipefail | |
CONTAINER_NAME="uptime-kuma" | |
DATETIME="$(date -Ins)" | |
FILENAME="uptime-kuma-${DATETIME}.zip" | |
mkdir -p backup | |
docker exec ${CONTAINER_NAME} sh -c "apt update && apt install zip && mkdir -p /root/backup" | |
docker exec ${CONTAINER_NAME} sh -c "zip -r /root/backup/${FILENAME} /app/data" | |
docker cp ${CONTAINER_NAME}:/root/backup/${FILENAME} $(pwd)/backup/ | |
docker exec ${CONTAINER_NAME} sh -c "rm /root/backup/${FILENAME}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
set -euxo pipefail | |
docker run \ | |
--detach \ | |
--restart=unless-stopped \ | |
--publish 3001:3001 \ | |
--volume uptime-kuma:/app/data \ | |
--name uptime-kuma \ | |
louislam/uptime-kuma:debian | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment