summaryrefslogtreecommitdiff
path: root/.scripts/dmrsyncfon
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-03-12 19:54:51 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-03-12 19:54:51 +0530
commit54b772cae06eb25adf33297e35234f33ded81a7b (patch)
treef287ee48faa8013e4a8f0ee764a6d3cd850bb24d /.scripts/dmrsyncfon
parent7197e45d94dbcf4877d585fff8e634896876ae83 (diff)
neovim addition
Diffstat (limited to '.scripts/dmrsyncfon')
-rwxr-xr-x.scripts/dmrsyncfon24
1 files changed, 24 insertions, 0 deletions
diff --git a/.scripts/dmrsyncfon b/.scripts/dmrsyncfon
new file mode 100755
index 0000000..6d01cb6
--- /dev/null
+++ b/.scripts/dmrsyncfon
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+echo "Welcome to rsyncfon a fon to pc and vice-versa file-syncing script using the rsync algorithm!"
+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
+