-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmirror_to_dropbox.sh
More file actions
executable file
·37 lines (33 loc) · 1.07 KB
/
mirror_to_dropbox.sh
File metadata and controls
executable file
·37 lines (33 loc) · 1.07 KB
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
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Mirror a filtered snapshot of /Users/bob/LHM into ~/Dropbox/LHM
# so the folder is readable from the Dropbox mobile app.
#
# - One-way rsync (Dropbox is a read-only mirror; never sync back).
# - Excludes heavy or phone-useless paths (Data, OpenBB, Archive, .git, caches).
# - Uses --delete so the mirror stays clean when files are removed locally.
set -u
SRC="/Users/bob/LHM/"
DST="$HOME/Dropbox/LHM/"
LOG="/Users/bob/LHM/logs/dropbox_mirror.log"
mkdir -p "$DST"
{
echo "=== $(date '+%Y-%m-%d %H:%M:%S') mirror start ==="
rsync -a --delete \
--exclude='.git/' \
--exclude='.venv/' \
--exclude='venv/' \
--exclude='__pycache__/' \
--exclude='*.pyc' \
--exclude='.DS_Store' \
--exclude='.dropbox.cache/' \
--exclude='.ipynb_checkpoints/' \
--exclude='node_modules/' \
--exclude='Data/' \
--exclude='OpenBB/' \
--exclude='OpenBBUserData/' \
--exclude='Archive/' \
--exclude='*.db-wal' \
--exclude='*.db-shm' \
"$SRC" "$DST"
echo "=== $(date '+%Y-%m-%d %H:%M:%S') mirror end (exit $?) ==="
} >> "$LOG" 2>&1