This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
admin
Signed in as
admin
Profile
Starred
Subscriptions
Settings
Help
Site Administration
Sign Out
admin
/
homelab
Watching
1
Participating and mentions
Receive notifications from this repository when participating or mentioned.
All activity
Receive notifications for all events.
Ignore
Never receive notifications from this repository.
Custom
Select events you want to be notified of, in addition to participating and mentions.
Star
0
Fork
0
Notifications
Issues
Pull Requests
Releases
Cancel
Confirm
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Settings
Files
homelab
/
scripts
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
#!/usr/bin/env bash # ============================================================================== # Mac mini 核心数据自动备份至极空间 Z4 (20TB NAS) 脚本 # 每天凌晨 03:30 自动打包备份 Vaultwarden 密码库、Sun-Panel 导航页及 Homelab 配置 # ============================================================================== set -euo pipefail NAS_BACKUP_DIR="/Users/ixvii0iv/nas/个人空间/MacMini_Backups" TIMESTAMP=$(date '+%Y%m%d_%H%M%S') # 确保极空间已挂载 /Users/ixvii0iv/homelab/scripts/mount-zspace.sh >/dev/null 2>&1 || true if [ ! -d "/Users/ixvii0iv/nas/个人空间" ]; then echo "[$(date '+%Y-%m-%d %H:%M:%S')] [WARN] 极空间未挂载,跳过本次备份" exit 0 fi mkdir -p "$NAS_BACKUP_DIR" ARCHIVE="$NAS_BACKUP_DIR/homelab_backup_${TIMESTAMP}.tar.gz" tar -czf "$ARCHIVE" \ -C /Users/ixvii0iv/homelab \ stacks/vaultwarden/data \ stacks/portal \ configs \ scripts \ README.md PLAN.md CHANGELOG.md 2>/dev/null || true # 保留最近 30 份备份 COUNT=$(ls -1t "$NAS_BACKUP_DIR"/homelab_backup_*.tar.gz 2>/dev/null | wc -l | tr -d ' ') ls -1t "$NAS_BACKUP_DIR"/homelab_backup_*.tar.gz 2>/dev/null | tail -n +31 | xargs rm -f 2>/dev/null || true MSG="[$(date '+%Y-%m-%d %H:%M:%S')] [OK] 已备份至极空间 (共${COUNT}份): $ARCHIVE" echo "$MSG" mkdir -p /Users/ixvii0iv/homelab/logs echo "$MSG" >> /Users/ixvii0iv/homelab/logs/nas-backup.log
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
main
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel