Created
May 14, 2019 15:55
-
-
Save JakeDEvans/b831cbdd6d72131adbf42a47a4619fb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# make sure we never run 2 rsync at the same time | |
lockfile="/tmp/alpine-mirror-v3.9.lock" | |
if [ -z "$flock" ] ; then | |
exec env flock=1 flock -n $lockfile "$0" "$@" | |
fi | |
src=rsync://rsync.alpinelinux.org/alpine/v3.9/ | |
dest=/var/www/localhost/htdocs/alpine/v3.9/ | |
mkdir -p "$dest" | |
/usr/bin/rsync \ | |
--archive \ | |
--update \ | |
--hard-links \ | |
--delete \ | |
--delete-after \ | |
--delay-updates \ | |
--timeout=600 \ | |
"$src" "$dest" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment