From 18c64bb6674477614e773bc45bac267c207a1402 Mon Sep 17 00:00:00 2001 From: Awin Huang Date: Thu, 25 Jan 2024 12:42:00 +0800 Subject: [PATCH] vault backup: 2024-01-25 12:42:00 --- .obsidian/core-plugins.json | 22 ---------------------- 00. Inbox/樹莓派/00. 樹莓派.canvas | 6 +++--- 00. Inbox/樹莓派/backup_pi.sh.md | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 25 deletions(-) create mode 100644 00. Inbox/樹莓派/backup_pi.sh.md diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json index 53bce80..e69de29 100644 --- a/.obsidian/core-plugins.json +++ b/.obsidian/core-plugins.json @@ -1,22 +0,0 @@ -[ - "file-explorer", - "global-search", - "switcher", - "graph", - "backlink", - "canvas", - "tag-pane", - "properties", - "page-preview", - "daily-notes", - "templates", - "note-composer", - "command-palette", - "bookmarks", - "markdown-importer", - "random-note", - "outline", - "word-count", - "workspaces", - "file-recovery" -] \ No newline at end of file diff --git a/00. Inbox/樹莓派/00. 樹莓派.canvas b/00. Inbox/樹莓派/00. 樹莓派.canvas index 4f7f606..a08521d 100644 --- a/00. Inbox/樹莓派/00. 樹莓派.canvas +++ b/00. Inbox/樹莓派/00. 樹莓派.canvas @@ -9,14 +9,14 @@ {"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":"a63a5baed201beda","type":"text","text":"![[設定日誌大小]]","x":480,"y":160,"width":360,"height":180}, + {"id":"6e59f6b9f36b24e2","type":"text","text":"![[安裝]]","x":-40,"y":132,"width":383,"height":177}, {"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":"b900ad17a2841b99","type":"text","text":"# 安裝 Filebrowser\n[官方安裝流程](https://filebrowser.org/installation#docker)","x":1400,"y":-340,"width":440,"height":120}, {"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","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} + {"id":"ff16e3814718d144","type":"text","text":"# 設定 crontab\n1. 用[[ddns.sh]]定時更新DNS\n2. 用[[backup_docker_gitea.sh]]備份 gitea docker\n3. 用[[backup_pi.sh]]備份整張SD卡","x":1400,"y":-190,"width":440,"height":150} ], "edges":[ {"id":"9683c15c63c167c0","fromNode":"6e59f6b9f36b24e2","fromSide":"right","toNode":"e94c9e71b9aeaa89","toSide":"left"}, diff --git a/00. Inbox/樹莓派/backup_pi.sh.md b/00. Inbox/樹莓派/backup_pi.sh.md new file mode 100644 index 0000000..c17e0f9 --- /dev/null +++ b/00. Inbox/樹莓派/backup_pi.sh.md @@ -0,0 +1,15 @@ +```shell +#!/bin/sh + +NOW_DATETIME="$(date +'%Y%m%d_%H%M%S')" +SAVE_FOLDER="/media/upload/pi_backup" +SAVE_FILENAME="pi4_$NOW_DATETIME.img" +CMD="sudo /home/awin/bin/image-utils/image-backup -i $SAVE_FOLDER/$SAVE_FILENAME" +LOG_FILE="/home/awin/log/backup_pi4.log" + +mkdir -p $SAVE_FOLDER + +echo "$(date +'%F %R:%S'): Backup start. CMD = $CMD" > $LOG_FILE +$CMD +echo "$(date +'%F %R:%S'): Backup finished." >> $LOG_FILE +``` \ No newline at end of file