summaryrefslogtreecommitdiff
path: root/rsync.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rsync.sh')
-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