-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObsidian_template_sync
More file actions
executable file
·35 lines (29 loc) · 966 Bytes
/
Obsidian_template_sync
File metadata and controls
executable file
·35 lines (29 loc) · 966 Bytes
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
#!/bin/bash
MASTER=$HOME/Obsidian/Master
ARCHIVE=.archive
IFS="
"
#for DIR in $(find $HOME/Obsidian -type d -iname 'Templates')
#do
# [ "$DIR" = "$MASTER" ] && continue
# echo $DIR
# echo "---Pull---"
# rsync -aCvb "$DIR/" "$MASTER/" --backup-dir=$ARCHIVE/$(date '+%Y-%m-%d_%H%M')/ --exclude=$ARCHIVE
# echo "
#
# "
#done
for DIR in $(find $HOME/Obsidian -type d -iname 'Templates')
do
[ "$DIR" = "$MASTER/Templates" ] && continue
#echo "---Push---"
#rsync -aCb "$MASTER/" "$DIR/" --backup-dir=$ARCHIVE/$(date '+%Y-%m-%d_%H%M')/ --exclude=$ARCHIVE --delete
rsync -aC "$MASTER/Templates/" "$DIR/" --delete
done
for DIR in $(find $HOME/Obsidian -type d -iname 'Instructional')
do
[ "$DIR" = "$MASTER/Instructional" ] && continue
#echo "---Push---"
#rsync -aCb "$MASTER/" "$DIR/" --backup-dir=$ARCHIVE/$(date '+%Y-%m-%d_%H%M')/ --exclude=$ARCHIVE --delete
rsync -aC "$MASTER/Instructional/" "$DIR/" --delete
done