2023-02-25 18:29:45 +00:00
|
|
|
#!/data/data/com.termux/files/usr/bin/sh
|
|
|
|
|
|
|
|
# debugging
|
|
|
|
#echo $1
|
|
|
|
#export RC_DEBUG="-P --dry-run"
|
|
|
|
|
|
|
|
# org storage locations
|
|
|
|
export LOCAL_BOOKS="/data/data/com.termux/files/home/storage/shared/Books/"
|
|
|
|
export NC_BOOKS="nc-personal:/Books/"
|
|
|
|
|
|
|
|
# rclone common flags/switches
|
2024-08-15 22:30:32 +00:00
|
|
|
export RC_COMMON="--modify-window=1s --delete-after --fast-list --human-readable --interactive"
|
2023-02-25 18:29:45 +00:00
|
|
|
export RC_EXCLUDE="--exclude=/Apps/** --exclude=/.MoonReader/** --exclude=/MoonReader/**"
|
|
|
|
|
|
|
|
# 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 books rclone from nextcloud -> local storage"
|
|
|
|
/data/data/com.termux/files/usr/bin/rclone sync \
|
|
|
|
$RC_COMMON $RC_EXCLUDE $RC_DEBUG \
|
|
|
|
$NC_BOOKS $LOCAL_BOOKS
|
|
|
|
|
|
|
|
# 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
|