chris-website-content/sync.sh

23 lines
600 B
Bash
Raw Permalink Normal View History

2020-07-18 01:24:52 +00:00
#!/usr/bin/env bash
2021-02-10 14:24:02 +00:00
remote="chrisblog@netsoj.nl:"
2020-07-18 01:24:52 +00:00
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.
2021-02-10 14:24:02 +00:00
flags="-brzPthX --exclude mijnblog --exclude .git --suffix .old --stats"
2020-07-18 01:24:52 +00:00
case $1 in
"pull")
shift
rsync $flags $@ $remote $notremote;;
"push")
shift
rsync $flags $@ $notremote $remote;;
*)
echo "usage: $0 [push|pull] <arguments to rsync...>";;
esac