From 4f36d5656c983c79543a207693da903ae669b0f2 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Tue, 26 Mar 2024 13:33:01 -0400 Subject: [PATCH] adjust rclone sync from nc -> local to be faster/more tuned for regular use --- shortcuts/rclone-nc-local | 11 +++++++---- shortcuts/rclone-nc-local-full | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100755 shortcuts/rclone-nc-local-full diff --git a/shortcuts/rclone-nc-local b/shortcuts/rclone-nc-local index 2cc66fa..ee9a4bb 100755 --- a/shortcuts/rclone-nc-local +++ b/shortcuts/rclone-nc-local @@ -8,8 +8,8 @@ export LOCAL_ORG="/data/data/com.termux/files/home/storage/shared/org/" export NC_ORG="nc-personal:/org/" -# rclone common flags/switches -export RC_COMMON="--delete-after --fast-list --human-readable --interactive" +# rclone common flags/switch +export RC_COMMON="--fast-list --human-readable -P --max-depth=2" # get a wake lock so we dont get background killed /data/data/com.termux/files/usr/bin/termux-wake-lock @@ -25,8 +25,11 @@ echo "starting rclone from nextcloud -> local storage" $NC_ORG $LOCAL_ORG # pause to review rclone output -echo "press enter to continue" -read junkvar +#echo "press enter to continue" +#read junkvar # release wake lock /data/data/com.termux/files/usr/bin/termux-wake-unlock + +echo "Press enter to exit" +read junkvar diff --git a/shortcuts/rclone-nc-local-full b/shortcuts/rclone-nc-local-full new file mode 100755 index 0000000..aceadfc --- /dev/null +++ b/shortcuts/rclone-nc-local-full @@ -0,0 +1,35 @@ +#!/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/" + +# rclone common flags/switches +export RC_COMMON="--delete-after --fast-list --human-readable -P" + +# 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 \ + $RC_COMMON $RC_DEBUG \ + --filter "+ /Documents/Resume/**" \ + --filter "- archivebox" \ + --filter "- /Attic/" \ + --filter "- /Documents/" \ + $NC_ORG $LOCAL_ORG + +# pause to review rclone output +#echo "press enter to continue" +#read junkvar + +# release wake lock +/data/data/com.termux/files/usr/bin/termux-wake-unlock + +echo "Press enter to exit" +read junkvar