<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=4301&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Copy files from a playlist to a USB device]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=4301</link>
		<description><![CDATA[The most recent posts in Copy files from a playlist to a USB device.]]></description>
		<lastBuildDate>Sat, 01 May 2021 11:56:39 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29518#p29518</link>
			<description><![CDATA[<p>head on a stick nailed it.</p><p>I did a test with rsync and this is how i went about it, although i would probably stick with the bash command from head on a stick.</p><p>first created a dummy directory for testing.</p><div class="codebox"><pre><code>~$ tree audio/
audio/
└── cds
    ├── 1
    │   └── 1.mp3
    ├── 2
    │   └── 2.mp3
    ├── 3
    │   └── 3.mp3
    └── 4

5 directories, 3 files</code></pre></div><p>then created my playlist.m3u</p><div class="codebox"><pre><code>find /home/dice/audio/cds/ -type f -iname &quot;*.mp3&quot; &gt; playlist.m3u</code></pre></div><p>the contents of playlist.m3u</p><div class="codebox"><pre><code>/home/dice/audio/cds/2/2.mp3
/home/dice/audio/cds/3/3.mp3
/home/dice/audio/cds/1/1.mp3</code></pre></div><p>then added a random directory number 5 not on the playlist.</p><div class="codebox"><pre><code>~$ tree audio/
audio/
└── cds
    ├── 1
    │   └── 1.mp3
    ├── 2
    │   └── 2.mp3
    ├── 3
    │   └── 3.mp3
    ├── 4
    └── 5
        └── 5.mp3

6 directories, 4 files</code></pre></div><p>created test directory for the rsync.</p><div class="codebox"><pre><code>/home/dice/test-usb-dir</code></pre></div><p>now the rsync command.</p><p><del>rsync -a --include-from=/home/dice/playlist.m3u --delete --delete-excluded --prune-empty-dirs /home/dice/audio test-usb-dir/</del></p><p>edit: this command is better </p><div class="codebox"><pre><code>rsync -av --relative $(cat ~/playlist.m3u) test-usb-dir/</code></pre></div><p>result</p><div class="codebox"><pre><code>~$ tree test-usb-dir/
test-usb-dir/
└── home
    └── dice
        └── audio
            └── cds
                ├── 1
                │   └── 1.mp3
                ├── 2
                │   └── 2.mp3
                └── 3
                    └── 3.mp3

7 directories, 3 files</code></pre></div><p>this seems to work for me and I will test this with some actual audio files in music directory soon.</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Sat, 01 May 2021 11:56:39 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29518#p29518</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29505#p29505</link>
			<description><![CDATA[<p>@HOAS: thanks for that simple bash line, it did the job. 470 files and 19G of data have been copied.</p><p>That link yyou posted looks interesting, more examples than the Advanced Scripting Guide I tried to work with. Is bookmarked. </p><p>Everybody have a nice weekend.</p><p>rolfie</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Fri, 30 Apr 2021 19:31:38 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29505#p29505</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29500#p29500</link>
			<description><![CDATA[<p>Try</p><div class="codebox"><pre><code>while IFS= read -r line ; do cp -- &quot;$line&quot; /media/usb_device ; done &lt; /home/rolf/Musik/Test.m3u</code></pre></div><p>Reference: <a href="https://mywiki.wooledge.org/BashFAQ/001" rel="nofollow">https://mywiki.wooledge.org/BashFAQ/001</a></p><p>EDIT: added <span class="bbc">--</span> to the <span class="bbc">cp</span> command to accommodate filenames that start with <span class="bbc">-</span>.</p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Fri, 30 Apr 2021 17:11:44 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29500#p29500</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29498#p29498</link>
			<description><![CDATA[<p>My intention is just to copy the files listed in the playlist, and not all the CDs from the server. Simple reason being space available.</p><p>Thanks for the link to Stackexchange. At first sight rsync looks promising, at least it might allow for using the specs in the m3u file. I have started to fiddle with the example given there and tried to adapt it to my needs. But its not exactly going as I would expect. </p><p>As a start I have reduced the list of files to be copied to 3 to be able to test the options. And I have prepared an empty space on a drive on my workstation. I have left out the sed stuff, since the 3 test files just contain a lot of spaces. Thought that should work. Something still isn&#039;t right.</p><div class="codebox"><pre><code>~/Musik$ rsync -a --include-from=/home/rolf/Musik/Test.m3u --include=&#039;*/&#039; --exclude=&#039;*&#039; /srv/Audio/ /mnt/Daten/rolf/Audio --progress --prune-empty-dirs
building file list ... 
403 files to consider
./
~/Musik$ rsync -a --files-from=/home/rolf/Musik/Test.m3u --include=&#039;*/&#039; --exclude=&#039;*&#039; /srv/Audio/ /mnt/Daten/rolf/Audio --progress --prune-empty-dirs
building file list ... 
rsync: link_stat &quot;/srv/Audio/srv/Audio/CDs/Adele - Adele21/Adele - Rolling in the deep.wav&quot; failed: No such file or directory (2)
rsync: link_stat &quot;/srv/Audio/srv/Audio/CDs/Adele - Adele21/Adele - Set fire to the rain.wav&quot; failed: No such file or directory (2)
rsync: link_stat &quot;/srv/Audio/srv/Audio/CDs/Adele - Adele21/Adele - Someone like you.wav&quot; failed: No such file or directory (2)
0 files to consider
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1207) [sender=3.1.3]
~/Musik$ rsync -a --files-from=/home/rolf/Musik/Test.m3u --include=&#039;*/&#039; --exclude=&#039;*&#039; / /mnt/Daten/rolf/Audio --progress --prune-empty-dirs
building file list ... 0 files to consider
~/Musik$ rsync -a --files-from=/home/rolf/Musik/Test.m3u --include=&#039;*/&#039; --exclude=&#039;*&#039; // /mnt/Daten/rolf/Audio --progress --prune-empty-dirs
building file list ... 0 files to consider</code></pre></div><p>Any idea what not right?</p><p>rolfie</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Fri, 30 Apr 2021 16:54:12 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29498#p29498</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29492#p29492</link>
			<description><![CDATA[<p>To clarify a bit more having sort of understood what you want, rsync is your tool here.</p><p>Have a look at this.</p><p><a href="https://unix.stackexchange.com/questions/14136/rsync-an-mpd-playlist" rel="nofollow">https://unix.stackexchange.com/question … d-playlist</a></p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Fri, 30 Apr 2021 13:45:17 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29492#p29492</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29489#p29489</link>
			<description><![CDATA[<p>In that case id just clone the directories /srv/Audio/CDs using rsync ?</p><p>and then copy over the .m3u file to the usb, wouldnt that work?</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Fri, 30 Apr 2021 13:08:35 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29489#p29489</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29488#p29488</link>
			<description><![CDATA[<p>The playlist is a selection of *.wav files, grown over the years from a Winamp playlist under Windows. On the server I have stored all the ripped CDs I own, one directory per CD. And yes, the paths and file names contain whitespaces and special characters all over. I don&#039;t want to copy every single file but just the ones listed in the playlist. And about 500 files manually ......</p><p>rolfie</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Fri, 30 Apr 2021 12:59:06 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29488#p29488</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29487#p29487</link>
			<description><![CDATA[<div class="quotebox"><cite>ralph.ronnquist wrote:</cite><blockquote><div><p>EDIT: I forgot the m3u ...</p><div class="codebox"><pre><code>find /srv/Audio/CDs -name \*.wav -o -name \*.m3u -print0 | xargs -0 cp -t /media/usb_device</code></pre></div><p>or perhaps</p><div class="codebox"><pre><code>find /srv/Audio/CDs -type f -print0 | xargs -0 cp -t /media/usb_device</code></pre></div></div></blockquote></div><p>That second command does the job nicely.</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Fri, 30 Apr 2021 12:55:22 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29487#p29487</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29485#p29485</link>
			<description><![CDATA[<p>so what is the base directory, is it /srv/Audio/ for all 500 .wavs files and directories? Looks like you need to recurse into the many artists and album directories. Maybe tree the /srv/Audio/ directory to see what you have there?</p><div class="codebox"><pre><code>tree /srv/Audio/</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Fri, 30 Apr 2021 12:46:31 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29485#p29485</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29484#p29484</link>
			<description><![CDATA[<p>EDIT: I forgot the m3u ...</p><div class="codebox"><pre><code>find /srv/Audio/CDs -name \*.wav -o -name \*.m3u -print0 | xargs -0 cp -t /media/usb_device</code></pre></div><p>or perhaps</p><div class="codebox"><pre><code>find /srv/Audio/CDs -type f -print0 | xargs -0 cp -t /media/usb_device</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Fri, 30 Apr 2021 12:41:32 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29484#p29484</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29483#p29483</link>
			<description><![CDATA[<p>Thanks for your suggestion, but the MyMusic.m3u file isn&#039;t accepted as input for the copy operation. Here are 3 lines as they appear in the file: </p><div class="codebox"><pre><code>/srv/Audio/CDs/Adele - Adele21/Adele - Rolling in the deep.wav
/srv/Audio/CDs/Adele - Adele21/Adele - Set fire to the rain.wav
/srv/Audio/CDs/Adele - Adele21/Adele - Someone like you.wav
....</code></pre></div><p>Or is is the only way to write a script that uses the file as input line by line?</p><p>rolfie</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Fri, 30 Apr 2021 12:38:48 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29483#p29483</guid>
		</item>
		<item>
			<title><![CDATA[Re: Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29476#p29476</link>
			<description><![CDATA[<p>You should be able to glob/wildcard the .wav extension.</p><div class="codebox"><pre><code>cp server/playlist/*.wav /media/usb_device</code></pre></div><p> ?</p>]]></description>
			<author><![CDATA[dummy@example.com (dice)]]></author>
			<pubDate>Fri, 30 Apr 2021 11:31:56 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29476#p29476</guid>
		</item>
		<item>
			<title><![CDATA[Copy files from a playlist to a USB device]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=29475#p29475</link>
			<description><![CDATA[<p>Got an Audacious playlist MyMusic.m3u that lists about 500 wav files on my file server line by line. Is there an easy way to copy these wav&#039;s to a USB device?</p><p>Thanks, rolfie</p>]]></description>
			<author><![CDATA[dummy@example.com (rolfie)]]></author>
			<pubDate>Fri, 30 Apr 2021 11:20:10 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=29475#p29475</guid>
		</item>
	</channel>
</rss>
