diff options
Diffstat (limited to 'rsync.sh')
-rwxr-xr-x | rsync.sh | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 |