snipt

Ctrl+h for KB shortcuts

Text only

rsync only/alleen directories

1
2
3
4
5
rsync alleen directories

Om alleen een directoryboom te rsyncen, zonder files:

rsync -av -f"+ */" -f"- *" source/ destination
https://snipt.net/embed/8c42776b6e20af8ee646ea671edbd447/
/raw/8c42776b6e20af8ee646ea671edbd447/
8c42776b6e20af8ee646ea671edbd447
text
Text only
7
2019-08-20T21:21:35
True
False
False
/api/public/snipt/11324/
rsync-onlyalleen-directories
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>rsync alleen directories </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>Om alleen een directoryboom te rsyncen, zonder files: </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>rsync -av -f&quot;+ */&quot; -f&quot;- *&quot; source/ destination </span></pre></div> </td></tr></table>
alleen/only, directories, rsync

Bash

rsync over ssh

rsync -e ssh -av [email protected]:remote_directory local_directory
https://snipt.net/embed/3f15931dada41036aa3c7158d5a7510f/
/raw/3f15931dada41036aa3c7158d5a7510f/
3f15931dada41036aa3c7158d5a7510f
bash
Bash
2
2019-08-17T14:38:16
True
False
False
/api/public/snipt/9711/
rsync-over-ssh
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>rsync -e ssh -av [email protected]:remote_directory local_directory </span></pre></div> </td></tr></table>
bash, rsync, server, syncing

Bash

rsync command

1
2
3
4
5
$rsync -rvu --rsync-path="sudo rsync" [email protected]:/var/www/survey/* .

#for syncing symfony dirs from the server to .

#Sometimes you don't need the --rsync-path parameter
https://snipt.net/embed/8d6b42ffe84281688412f9af801061b9/
/raw/8d6b42ffe84281688412f9af801061b9/
8d6b42ffe84281688412f9af801061b9
bash
Bash
5
2019-08-15T09:45:04
True
False
False
/api/public/snipt/7983/
rsync-command
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nv">$rsync</span> -rvu --rsync-path<span class="o">=</span><span class="s2">&quot;sudo rsync&quot;</span> [email protected]:/var/www/survey/* . </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1">#for syncing symfony dirs from the server to .</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c1">#Sometimes you don&#39;t need the --rsync-path parameter</span> </span></pre></div> </td></tr></table>
rsync, sysadmin

Bash

rsync contents of remote directory to current directory

rsync -avx -e ssh [email protected]:/directory/ .
https://snipt.net/embed/e5bb95b6ddfa13152d6928990043becc/
/raw/e5bb95b6ddfa13152d6928990043becc/
e5bb95b6ddfa13152d6928990043becc
bash
Bash
1
2019-07-11T10:45:10
True
False
False
/api/public/snipt/2587/
rsync-contents-of-remote-directory-to-current-directory
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>rsync -avx -e ssh [email protected]:/directory/ . </span></pre></div> </td></tr></table>
rsync

Bash

rsync remote directory to current directory

rsync -avx -e ssh [email protected]:/directory .
https://snipt.net/embed/9fb836c861868a9f8c44d695dccd47f3/
/raw/9fb836c861868a9f8c44d695dccd47f3/
9fb836c861868a9f8c44d695dccd47f3
bash
Bash
1
2019-08-15T23:34:23
True
False
False
/api/public/snipt/2586/
rsync-remote-directory-to-current-directory
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>rsync -avx -e ssh [email protected]:/directory . </span></pre></div> </td></tr></table>
rsync