#!/data/data/com.termux/files/usr/bin/sh device="`cat /data/data/com.termux/files/home/device`" if [ ! "$device" ] then termux-notification -c "[$0] no device" exit 1 fi flock -n -E 0 \ /data/data/com.termux/files/home/rsync.lock \ rsync -vhhhirlt --progress --no-perms \ --chmod=D755,F644 --exclude=/Android/data \ --exclude=/Android/obb --delete --delete-excluded \ -e 'ssh -i'\ " /data/data/com.termux/files/home/.ssh/$device" \ /storage/emulated/0/ \ "$device@$device.connection-targets.rsync.si.pri.ee"\ ":data/$device/" exit_code="$?" if [ "$exit_code" -ne 0 ] then termux-notification \ -c "[$0] rsync exit code = $exit_code" fi