aboutsummaryrefslogtreecommitdiff
path: root/src/docs/Setting-up-an-rsync-repository-for-distribution.html
blob: 5c94c69479c69372b22e38d779c7621655e697cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2020 Cem Keylan

Licensed under Gnu Free Documentation License. -->
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Setting up an rsync repository for distribution (Carbs Linux User Manual)</title>

<meta name="description" content="Setting up an rsync repository for distribution (Carbs Linux User Manual)">
<meta name="keywords" content="Setting up an rsync repository for distribution (Carbs Linux User Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Rsync-Repositories.html" rel="up" title="Rsync Repositories">
<link href="Contribution-Guidelines.html" rel="next" title="Contribution Guidelines">
<link href="Rsync-Repositories.html" rel="prev" title="Rsync Repositories">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<span id="Setting-up-an-rsync-repository-for-distribution"></span><div class="header">
<p>
Up: <a href="Rsync-Repositories.html" accesskey="u" rel="up">Rsync Repositories</a> &nbsp; </p>
</div>
<hr>
<span id="Setting-up-an-rsync-repository-for-distribution-1"></span><h4 class="subsection">2.5.1 Setting up an rsync repository for distribution</h4>

<p>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.
</p>
<pre class="verbatim">    #!/bin/sh
    HOSTNAME=&quot;rsync://carbslinux.org/repo&quot;
    GITDIR=&quot;/pub/git/repo&quot;
    SHAREDIR=&quot;/pub/share/repo&quot;
    git -C &quot;$GITDIR&quot; pull

    rsync -avcC --delete --include=core --exclude=.rsync,.rsync_root &quot;$GITDIR/.&quot; &quot;$SHAREDIR&quot;

    printf '%s\n' &quot;$HOSTNAME&quot; &gt; &quot;$GITDIR/.rsync&quot;
    for dir in &quot;$GITDIR/&quot;*; do
        [ -d &quot;$dir&quot; ] || continue
        [ -f &quot;$dir/.rsync&quot; ] ||
        printf '%s/%s\n' &quot;$HOSTNAME&quot; &quot;${dir##*/}&quot; &gt; &quot;$dir/.rsync&quot;
        printf '..\n' &gt; &quot;$dir/.rsync_root&quot;
    done
</pre>
<p>You can then create an <strong>rsync</strong> user for serving the repositories.
</p>
<div class="example">
<pre class="example">$ adduser -SD rsync
</pre></div>

<p>Create <samp>/etc/rsyncd.conf</samp> and a service configuration as well.
</p>
<pre class="verbatim">
    uid = rsync
    gid = rsync
    address = example.com
    max connections = 10
    use chroot = yes

    [repo]
        path = /pub/share/repo
        comment = My repository
</pre>
<p>Create a service file at <samp>/etc/sv/rsync/run</samp> (runit):
</p>
<div class="example">
<pre class="example">#!/bin/sh
exec rsync --daemon --no-detach
</pre></div>




</body>
</html>