snipt

Ctrl+h for KB shortcuts

Bash

Rsync by especific extension

1
2
3
#Syncronize all files with extension flv and swf to destination, including paths,
#but exclude all other files
rsync -av --include '*/' --include '*.flv' --include '*.swf' --exclude '*' /source/ /destination/
https://snipt.net/embed/eca73edaf3be0619fb996af927340958/
/raw/eca73edaf3be0619fb996af927340958/
eca73edaf3be0619fb996af927340958
bash
Bash
3
2019-06-18T04:36:10
True
False
False
Sep 04, 2012 at 09:21 AM
/api/public/snipt/46676/
rsync-by-especific-extension
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">#Syncronize all files with extension flv and swf to destination, including paths,</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">#but exclude all other files</span> </span><span id="L-3"><a name="L-3"></a>rsync -av --include <span class="s1">&#39;*/&#39;</span> --include <span class="s1">&#39;*.flv&#39;</span> --include <span class="s1">&#39;*.swf&#39;</span> --exclude <span class="s1">&#39;*&#39;</span> /source/ /destination/ </span></pre></div> </td></tr></table>
rsync