chris-website-content/sync.sh
2020-07-18 03:24:52 +02:00

23 lines
574 B
Bash
Executable file

#!/usr/bin/env bash
remote="mijnblog@netsoj.nl:site/"
notremote="."
# z = compress
# r = recursive (I don't want to keep owner and such)
# P = progress + partial
# t = preserve modification times
# h = show human readable numbers
# X = preserve extended attributes
# --exclude mijnblog = don't send that huge binary over thousands of times.
flags="-rzPthX --exclude mijnblog --stats"
case $1 in
"pull")
shift
rsync $flags $@ $remote $notremote;;
"push")
shift
rsync $flags $@ $notremote $remote;;
*)
echo "usage: $0 [push|pull] <arguments to rsync...>";;
esac