Last active
March 21, 2025 17:47
-
-
Save gdamjan/cc3a65cf9afa5fd7645c to your computer and use it in GitHub Desktop.
Revisions
-
gdamjan revised this gist
Dec 4, 2023 . 2 changed files with 21 additions and 13 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ pool/packages core core-testing extra extra-testing multilib multilib-testing lastsync lastupdate 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 charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,24 @@ #! /bin/bash set -euo pipefail if [ "$EUID" -eq 0 ] then echo "Don't run as root!" exit 1 fi REPO=rsync://ftp.acc.umu.se/mirror/archlinux DEST=/srv/arch_mirror/archlinux RSYNC_FILE_LIST=/srv/arch_mirror/archlinux-rsync-file-list.txt mkdir -p $DEST # Common rsync options : "${LAZY:="--delete-delay --delay-updates"}" RSYNC_OPTS="-rltH -4 --safe-links --no-motd $LAZY" # Only be verbose on tty if tty -s; then RSYNC_OPTS="$RSYNC_OPTS -v" fi /usr/bin/rsync $RSYNC_OPTS --files-from=$RSYNC_FILE_LIST $REPO/ $DEST/ -
gdamjan revised this gist
May 18, 2018 . 2 changed files with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Description=Mirror arch linux [Service] Type=oneshot ExecStart=/usr/local/bin/sync_arch_mirror.sh User=arch IPAccounting=yes NoNewPrivileges=yes 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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,8 @@ set -e REPO=rsync://ftp.acc.umu.se/mirror/archlinux/ DEST=/home/arch/public_html/archlinux/ mkdir -p $DEST # Common rsync options RSYNC_OPTS="-rtlH -4 --safe-links --no-motd --exclude=.*" -
gdamjan revised this gist
Oct 25, 2017 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,3 +7,15 @@ ExecStart=/home/arch/sync_arch_mirror.sh User=arch IPAccounting=yes NoNewPrivileges=yes PrivateTmp=yes PrivateDevices=yes ProtectSystem=strict ProtectControlGroups=yes ProtectKernelTunables=yes ProtectKernelModules=yes MemoryDenyWriteExecute=yes RestrictRealtime=yes RestrictNamespaces=yes RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 SystemCallArchitectures=native LockPersonality=yes -
gdamjan revised this gist
Oct 24, 2017 . 2 changed files with 12 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,6 @@ Description=Mirror arch linux [Service] Type=oneshot ExecStart=/home/arch/sync_arch_mirror.sh User=arch IPAccounting=yes NoNewPrivileges=yes 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 charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,23 @@ #! /bin/bash set -e REPO=rsync://ftp.acc.umu.se/mirror/archlinux/ DEST=/home/arch/public_html/archlinux/ # Common rsync options RSYNC_OPTS="-rtlH -4 --safe-links --no-motd --exclude=.*" # Only be verbose on tty if tty -s; then RSYNC_OPTS="$RSYNC_OPTS -v" fi # first get new package files (the pool) and don't delete anything /usr/bin/rsync $RSYNC_OPTS $REPO/pool/ $DEST/pool/ # … and only then get the database, links and the structure /usr/bin/rsync $RSYNC_OPTS --delete-after --delay-updates $REPO $DEST \ --exclude iso/ --exclude other/ --exclude archive/ --exclude sources/ # --delete-before so that it frees disk space earlier /usr/bin/rsync $RSYNC_OPTS --delete-before $REPO/iso/ $DEST/iso/ --exclude archboot -
gdamjan revised this gist
Jul 25, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ #! /bin/bash set -e REPO=rsync://mirror.de.leaseweb.net/archlinux/ DEST=/home/arch/public_html/archlinux/ -
gdamjan revised this gist
Jul 25, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ REPO=rsync://mirror.de.leaseweb.net/archlinux/ DEST=/home/arch/public_html/archlinux/ # Common rsync options RSYNC_OPTS="-rtlH -4 --safe-links --no-motd" # Only be verbose on tty if tty -s; then -
gdamjan revised this gist
Jul 25, 2015 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,4 @@ fi /usr/bin/rsync $RSYNC_OPTS $REPO/pool/ $DEST/pool/ # … and only then get the database, links and the structure /usr/bin/rsync $RSYNC_OPTS --delete-after --delay-updates $REPO $DEST -
gdamjan revised this gist
Jul 25, 2015 . 2 changed files with 17 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ [Unit] Description=Mirror arch linux [Service] Type=oneshot ExecStart=/home/arch/sync_arch_mirror.sh User=arch 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ [Unit] Description=Mirror arch almost every two hours [Timer] OnBootSec=15min OnUnitActiveSec=2h10m AccuracySec=10min [Install] WantedBy=timers.target -
gdamjan created this gist
Jul 25, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #! /bin/bash REPO=rsync://mirror.de.leaseweb.net/archlinux/ DEST=/home/arch/public_html/archlinux/ # Common rsync options RSYNC_OPTS="-rtlH -4 --safe-links" # Only be verbose on tty if tty -s; then RSYNC_OPTS="$RSYNC_OPTS -v" fi # first get new package files (the pool) /usr/bin/rsync $RSYNC_OPTS $REPO/pool/ $DEST/pool/ # … and only then get the database, links and the structure /usr/bin/rsync $RSYNC_OPTS --delete-after --delay-updates $REPO $DEST date > /tmp/last.sync