From 40eb4e45d48337dfcd748540fe25c5eb684e911d Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Wed, 9 Sep 2020 17:51:04 +0300 Subject: Install docs --- ...ng-up-an-rsync-repository-for-distribution.html | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 docs/docs/Setting-up-an-rsync-repository-for-distribution.html (limited to 'docs/docs/Setting-up-an-rsync-repository-for-distribution.html') diff --git a/docs/docs/Setting-up-an-rsync-repository-for-distribution.html b/docs/docs/Setting-up-an-rsync-repository-for-distribution.html new file mode 100644 index 0000000..2262723 --- /dev/null +++ b/docs/docs/Setting-up-an-rsync-repository-for-distribution.html @@ -0,0 +1,99 @@ + + + + + + +Setting up an rsync repository for distribution (Carbs Linux User Manual) + + + + + + + + + + + + + + + + +
+

+Up: Rsync Repositories  

+
+
+

2.3.1 Setting up an rsync repository for distribution

+ +

Carbs Linux repositories automatically sync from the git repostitories and serve +it through the rsync daemon. Here is a sample shell script that I use in order to +sync repositories. Feel free to customize for your own use. +

+
    #!/bin/sh
+    HOSTNAME="rsync://carbslinux.org/repo"
+    GITDIR="/pub/git/repo"
+    SHAREDIR="/pub/share/repo"
+    git -C "$GITDIR" pull
+
+    rsync -avcC --delete --include=core --exclude=.rsync,.rsync_root "$GITDIR/." "$SHAREDIR"
+
+    printf '%s\n' "$HOSTNAME" > "$GITDIR/.rsync"
+    for dir in "$GITDIR/"*; do
+        [ -d "$dir" ] || continue
+        [ -f "$dir/.rsync" ] ||
+        printf '%s/%s\n' "$HOSTNAME" "${dir##*/}" > "$dir/.rsync"
+        printf '..\n' > "$dir/.rsync_root"
+    done
+
+

You can then create an rsync user for serving the repositories. +

+
+
$ adduser -SD rsync
+
+ +

Create /etc/rsyncd.conf and a service configuration as well. +

+
+    uid = rsync
+    gid = rsync
+    address = example.com
+    max connections = 10
+    use chroot = yes
+
+    [repo]
+        path = /pub/share/repo
+        comment = My repository
+
+

Create a service file at /etc/sv/rsync/run (runit): +

+
+
#!/bin/sh
+exec rsync --daemon --no-detach
+
+ + + + + -- cgit v1.2.3