vault backup: 2024-01-22 18:03:29
This commit is contained in:
@@ -8,14 +8,15 @@
|
||||
{"id":"b77234a9cdf72aad","type":"text","text":"# 安裝 docker\n[[00. Inbox/Linux/Docker|Docker]]","x":940,"y":-340,"width":440,"height":120},
|
||||
{"id":"f210470376a4829d","type":"text","text":"![[設定Cloudflare DDNS]]","x":460,"y":370,"width":360,"height":150},
|
||||
{"id":"ef9431e16c90f57f","type":"text","text":"設定![[smb client]]","x":460,"y":540,"width":360,"height":180},
|
||||
{"id":"6e59f6b9f36b24e2","type":"text","text":"![[安裝]]","x":-80,"y":80,"width":383,"height":177},
|
||||
{"id":"a63a5baed201beda","type":"text","text":"![[設定日誌大小]]","x":480,"y":160,"width":360,"height":180},
|
||||
{"id":"d0711febf5985ed5","type":"text","text":"# 安裝nginx-certbot\n教學: [iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天](https://ithelp.ithome.com.tw/m/articles/10301801\n\nGithub: [JonasAlfredsson/docker-nginx-certbot: Automatically create and renew website certificates for free using the Let's Encrypt certificate authority.](https://github.com/JonasAlfredsson/docker-nginx-certbot)","x":940,"y":-190,"width":440,"height":240},
|
||||
{"id":"8cac63e48dff1f2a","type":"text","text":"# 安裝 Gitea\n官方教學:[Installation with Docker](https://docs.gitea.com/installation/install-with-docker)\n\n設定Gmail寄信:[Gitea 使用 Gmail 寄信 - 筆記ZONE](https://zonego.tw/2021/11/14/gitea-gmail/)\n","x":940,"y":80,"width":440,"height":140},
|
||||
{"id":"94fa9ef036dbe62a","type":"text","text":"# Speedtest 測試\n超簡單命令:`docker run --rm robinmanuelthiel/speedtest:latest`\n\nGithub: [robinmanuelthiel/speedtest: Check internet bandwidth from a Docker container and save the results to an InfluxDB](https://github.com/robinmanuelthiel/speedtest)","x":940,"y":253,"width":440,"height":207},
|
||||
{"id":"2a7d5efcc0f2dc0e","type":"text","text":"# 安裝 Portainer\n教學: [Portainer:一款圖形化容器管理工具|方格子 vocus](https://vocus.cc/article/643e9f74fd89780001b51739)\n\n官網:[Portainer: Container Management Software for Kubernetes and Docker](https://www.portainer.io/)","x":940,"y":489,"width":440,"height":191},
|
||||
{"id":"fc32cf264646fdec","type":"text","text":"# 安裝 Storj\n![[Storj]]","x":940,"y":720,"width":440,"height":200},
|
||||
{"id":"b900ad17a2841b99","x":1400,"y":-340,"width":440,"height":120,"type":"text","text":"# 安裝 Filebrowser\n[官方安裝流程](https://filebrowser.org/installation#docker)"}
|
||||
{"id":"b900ad17a2841b99","type":"text","text":"# 安裝 Filebrowser\n[官方安裝流程](https://filebrowser.org/installation#docker)","x":1400,"y":-340,"width":440,"height":120},
|
||||
{"id":"ff16e3814718d144","x":1400,"y":-190,"width":440,"height":130,"type":"text","text":"# 設定 crontab\n1. 用[[ddns.sh]]定時更新DNS\n2. 用[[backup_docker_gitea.sh]]備份 gitea docker"},
|
||||
{"id":"6e59f6b9f36b24e2","type":"text","text":"![[安裝]]","x":-40,"y":132,"width":383,"height":177}
|
||||
],
|
||||
"edges":[
|
||||
{"id":"9683c15c63c167c0","fromNode":"6e59f6b9f36b24e2","fromSide":"right","toNode":"e94c9e71b9aeaa89","toSide":"left"},
|
||||
|
||||
19
00. Inbox/樹莓派/backup_docker_gitea.sh.md
Normal file
19
00. Inbox/樹莓派/backup_docker_gitea.sh.md
Normal file
@@ -0,0 +1,19 @@
|
||||
```shell
|
||||
#!/bin/sh
|
||||
|
||||
WORK_DIR="/home/awin/docker/gitea"
|
||||
SAVE_PATH="/media/upload"
|
||||
NOW_DATETIME="$(date +'%Y%m%d_%H%M%S')"
|
||||
BACKUP_FILE_PATH="$SAVE_PATH/docker_backup/gitea/backup_docker_gitea_$NOW_DATETIME.tar"
|
||||
BACKUP_CMD="sudo tar -cvf $BACKUP_FILE_PATH data docker-compose.yml"
|
||||
|
||||
echo "$BACKUP_FILE_PATH"
|
||||
echo "$(date +'%F %R:%S'): Backup start. CMD = $BACKUP_CMD" > /home/awin/log/backup_docker_gitea.log
|
||||
|
||||
sudo docker compose -f $WORK_DIR/docker-compose.yml down
|
||||
cd $WORK_DIR
|
||||
$BACKUP_CMD
|
||||
sudo docker compose -f $WORK_DIR/docker-compose.yml up -d
|
||||
|
||||
echo "$(date +'%F %R:%S'): Backup finished." >> /home/awin/log/backup_docker_gitea.log
|
||||
```
|
||||
Reference in New Issue
Block a user