Fine tune rsync for just main & community x86_64 of v3.7. - Repo Mirror

2 posts / 0 new
Last post
#1 Mon, 2018-01-01 01:17
bdk907
  • bdk907's picture
  • Offline
  • Last seen: 2 months 3 weeks ago
  • Joined: 2018-01-01

I need some help in devising the correct include/exclude filters to mirror the v3.7 x86_64 main & community repos only.

I've read up on the various way to craft the rsync filters here:

https://superuser.com/questions/775140/how-can-i-rsync-a-set-of-subdirectories
https://injustfiveminutes.wordpress.com/2013/09/09/exclude-multiple-files-and-directories-with-rsync/
https://stackoverflow.com/questions/9952000/using-rsync-include-and-exclude-options-to-include-directory-and-file-by-pattern

But I haven't been able to hit on the correct pattern. Either rsync pulls down all of the v3.7 or none. I've been able to work around my lack of foo by way of cron jobbing two rsync's, one of main and one for community:

alpinerepo:/var/www/localhost/htdocs/alpine$ sudo rsync --archive --update --hard-links --delete \
--delete-after --delay-updates --timeout=600 --progress -vvv rsync://rsync.alpinelinux.org/alpine/v3.7/main/x86_64/* \
/var/www/localhost/htdocs/alpine/v3.7/main/x86_64/

alpinerepo:/var/www/localhost/htdocs/alpine$ sudo rsync --archive --update --hard-links --delete \
--delete-after --delay-updates --timeout=600 --progress -vvv rsync://rsync.alpinelinux.org/alpine/v3.7/community/x86_64/* \
/var/www/localhost/htdocs/alpine/v3.7/community/x86_64/

Thanks.

-Sean

Wed, 2018-01-03 02:36
bdk907
  • bdk907's picture
  • Offline
  • Last seen: 2 months 3 weeks ago
  • Joined: 2018-01-01

Problem solved.. Rsync requires iteration of every level of the path:

 rsync --archive --update --hard-links --delete --delete-after --delay-updates --timeout=600 \
 --include v3.7 \
 --include v3.7/main \
 --include v3.7/main/x86_64/*** \
 --include v3.7/community \
 --include v3.7/community/x86_64/*** \
 --exclude '***' \
 --progress -vvv \
 <a href="rsync://rsync.alpinelinux.org/alpine/" rel="nofollow">rsync://rsync.alpinelinux.org/alpine/</a> /var/www/localhost/htdocs/alpine/

Log in or register to post comments