2022-09-01 19:54:41 +00:00
|
|
|
#!/data/data/com.termux/files/usr/bin/sh
|
|
|
|
|
|
|
|
# debugging
|
|
|
|
#echo $1
|
|
|
|
#export RC_DEBUG="-P --dry-run"
|
|
|
|
|
|
|
|
# org storage locations
|
|
|
|
export LOCAL_ORG="/data/data/com.termux/files/home/storage/shared/org/"
|
|
|
|
export NC_ORG="nc-personal:/org/"
|
|
|
|
|
2024-03-26 17:33:01 +00:00
|
|
|
# rclone common flags/switch
|
2024-08-15 22:30:32 +00:00
|
|
|
export RC_COMMON="--modify-window=1s --fast-list --human-readable -P --max-depth=2"
|
2022-09-01 19:54:41 +00:00
|
|
|
|
|
|
|
# get a wake lock so we dont get background killed
|
|
|
|
/data/data/com.termux/files/usr/bin/termux-wake-lock
|
|
|
|
|
|
|
|
# sync org data to local device (pull down outstanding changes, if any)
|
|
|
|
echo "starting rclone from nextcloud -> local storage"
|
|
|
|
/data/data/com.termux/files/usr/bin/rclone sync \
|
2023-08-11 14:08:48 +00:00
|
|
|
$RC_COMMON $RC_DEBUG \
|
|
|
|
--filter "+ /Documents/Resume/**" \
|
|
|
|
--filter "- archivebox" \
|
|
|
|
--filter "- /Attic/" \
|
|
|
|
--filter "- /Documents/" \
|
2022-09-01 19:54:41 +00:00
|
|
|
$NC_ORG $LOCAL_ORG
|
|
|
|
|
|
|
|
# pause to review rclone output
|
2024-03-26 17:33:01 +00:00
|
|
|
#echo "press enter to continue"
|
|
|
|
#read junkvar
|
2022-09-01 19:54:41 +00:00
|
|
|
|
|
|
|
# release wake lock
|
|
|
|
/data/data/com.termux/files/usr/bin/termux-wake-unlock
|
2024-03-26 17:33:01 +00:00
|
|
|
|
|
|
|
echo "Press enter to exit"
|
|
|
|
read junkvar
|