scripts for phone
authorMauro Scomparin <scompo@gmail.com>
Sun, 6 Sep 2020 14:48:35 +0000 (16:48 +0200)
committerMauro Scomparin <scompo@gmail.com>
Sun, 6 Sep 2020 14:48:35 +0000 (16:48 +0200)
tel/download [new file with mode: 0755]
tel/upload [new file with mode: 0755]

diff --git a/tel/download b/tel/download
new file mode 100755 (executable)
index 0000000..22f7971
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Download a folder from a remote server with rsync using ssh
+
+. ~/.bashrc
+
+SERVER=server1.scompo.it
+SSH_USER=scompo
+
+LOCAL_FOLDER=$HOME
+REMOTE_FOLDER=~/personal/files
+
+rsync -rzhvae ssh --progress "$SSH_USER@$SERVER:$REMOTE_FOLDER" "$LOCAL_FOLDER" 
+
+read -p "Press any key to continue" ooo
diff --git a/tel/upload b/tel/upload
new file mode 100755 (executable)
index 0000000..f8bcba6
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Upload a directory to a server using rsync via ssh
+
+. ~/.bashrc
+
+SERVER=server1.scompo.it
+SSH_USER=scompo
+
+LOCAL_FOLDER=$HOME/files
+REMOTE_FOLDER=~/personal
+
+rsync -rzhvae ssh --progress "$LOCAL_FOLDER" "$SSH_USER@$SERVER:$REMOTE_FOLDER"
+
+read -p "Press any key to continue" ooo
+