From 55c57e0f57e10de7471a9de092d2bb3a652106f3 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan <79687674+Saumit-D@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:39:15 +0530 Subject: Add files via upload --- scripts/rsyncfon | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scripts/rsyncfon (limited to 'scripts/rsyncfon') diff --git a/scripts/rsyncfon b/scripts/rsyncfon new file mode 100644 index 0000000..bd1b9ae --- /dev/null +++ b/scripts/rsyncfon @@ -0,0 +1,24 @@ +#!/bin/bash + +echo "Welcome to rsyncfon a fon to pc rsync script" +echo -e "What would you like to do?\r\n1)sync from phone to pc 2)sync from pc to phone " +read option +case "$option" in + "1") + echo -e "Enter public IP on mobile device (starting with 192.): \r\n!Make sure the device and the desktop are connected to the same network!" + read IP + echo "Enter file/folder to be rsync'd (Leave empty if entire sdcard) (/sdcard/*)" + read file + echo "Enter desination path on PC \r\n!!!Make sure to check whether it had sufficient space or not!!!" + read dest + rsync --update --progress -e 'ssh -p 2222' -azv $IP:/sdcard/$file $dest;; + "2") + echo "Enter file/folder from pc to be rsync'd" + read file + echo "Enter public IP" + read IP + echo "Enter destination location( /sdcard/*)" + read dest + rsync --update --progress -e 'ssh -p 2222' -azv $file root@$IP:$dest +esac + -- cgit v1.2.3