summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Walker <dustin.walker@email.wsu.edu>2022-04-08 15:48:53 -0400
committerDustin Walker <dustin.walker@email.wsu.edu>2022-04-08 15:48:53 -0400
commit1a7ad404ebe4ddcdb2a70b54693e126d2de3a166 (patch)
tree4452025459d110b3647c0e211fa350680a68edd9
parent5834265dc2e480707c781311e55497e635f48898 (diff)
rsync.sh help info
-rwxr-xr-xrsync.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/rsync.sh b/rsync.sh
index 5698091..5bfb520 100755
--- a/rsync.sh
+++ b/rsync.sh
@@ -1,3 +1,11 @@
#!/bin/sh
+# rsync.sh
+# Quick script to rsync web files to their webserver with the specified port.
+
+# If we have no arguments, or the second argument is not a positive integer (drop failure output).
+if [ $# -eq 0 ] || ! [ $2 -gt 0 ] 2>/dev/null; then
+ echo "usage: rsync.sh <user@url> <port>"
+else
+ rsync -rtvzP -e "ssh -p $2" ./ $1:~/www
+fi
-rsync -rtvzP -e "ssh -p $2" ./ $1:~/www