Last active
October 30, 2017 17:48
-
-
Save reedrw/1d2ea9d0b1779cb144cd92bc284b0c75 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
#!/bin/bash | |
DEST='/var/www/html/archlinux' | |
MIRROR='rsync://mirrors.kernel.org/archlinux' | |
REPO='community community-staging community-testing core extra gnome-unstable iso kde-unstable multilib multilib-staging multilib-testing other pool sources testing' | |
function mirrorsync(){ | |
touch lockfile | |
for die in $REPO; do | |
printf "\n\nSyncing %s...\n============================\n\n" "$die" | |
rsync -rtlvH --delete-after --delay-updates --copy-links --safe-links "$MIRROR"/"$die" "$DEST" | |
done | |
rm lockfile | |
} | |
if [[ -e /home/reed/daemons/lockfile ]]; then | |
echo "lockfile" | |
else | |
[[ -d "$DEST" ]] && mirrorsync | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment