You are not logged in.

#1 2009-06-30 14:09:37

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

sucking out mp3 files off ipods [Solved]

Hi,

I wish to copy out mp3 files from ipod directories the dirs are F00 to F49 I need to find the mp3 files and copy them to another directory

tried

find . -name "*.mp3" -exec cp -rf --parents {} mynewdir \;

but it copied directories instead of just mp3's

what have I done wrong?

MrG


Mr Green

Offline

#2 2009-06-30 14:22:50

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: sucking out mp3 files off ipods [Solved]

cp */*mp3 dir/

?

Maybe more resource intensive (I have no clue), but it sure as hell does the job.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2009-06-30 14:45:07

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: sucking out mp3 files off ipods [Solved]

Here is my situation:

ju ~/Desktop/dest $  ls -R ../mp3/
../mp3/:
F01/  F02/  F03/  F04/

../mp3/F01:
1.mp3

../mp3/F02:
2.mp3

../mp3/F03:
3.mp3

../mp3/F04:
4.mp3

find ../mp3 -type f -name "*.mp3" -exec cp '{}' . \;

ju ~/Desktop/dest $  ls
1.mp3  2.mp3  3.mp3  4.mp3

It is easier to debug the behaviour of exec with echo cp

ju ~/Desktop/dest $  find ../mp3 -type f -name "*.mp3" -exec echo cp '{}' . \;
cp ../mp3/F03/3.mp3 .
cp ../mp3/F02/2.mp3 .
cp ../mp3/F01/1.mp3 .
cp ../mp3/F04/4.mp3 .


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#4 2009-06-30 15:15:58

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: sucking out mp3 files off ipods [Solved]

B wrote:
cp */*mp3 dir/

?

Maybe more resource intensive (I have no clue), but it sure as hell does the job.

my system slows right down running this one ;-) but its working yay!!!!!

MrG


Mr Green

Offline

#5 2009-06-30 15:22:33

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: sucking out mp3 files off ipods [Solved]

Globbing ftw tongue.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2009-06-30 15:35:13

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: sucking out mp3 files off ipods [Solved]

Mr Green wrote:
find . -name "*.mp3" -exec cp -rf --parents {} mynewdir \;

but it copied directories instead of just mp3's

what have I done wrong?

Anyway, I think it's this (from man cp) tongue

--parents
              use full source file name under DIRECTORY


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#7 2009-06-30 15:41:03

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: sucking out mp3 files off ipods [Solved]

emmm its really really pulling the cycles....

wondering if B's command is recursively copying ?

the find command did not work it copys the dir too I just want the mp3 files out of F00 to F49

Thanks

MrG


Mr Green

Offline

#8 2009-06-30 15:54:35

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: sucking out mp3 files off ipods [Solved]

If you copy everything to the same directory what about files with the same name? (maybe use cp --backup=t ?)

You should also use ./F[0-4][0-9]/*.mp3 (which will work with find with -path instead of -name)

Offline

#9 2009-06-30 15:56:50

arkham
Member
From: Stockholm
Registered: 2008-10-26
Posts: 516
Website

Re: sucking out mp3 files off ipods [Solved]

It's really weird.
Try

cd && mkdir mp3_backup && cd mp3_backup
find /media/IPOD -type f -name "*.mp3" -exec cp '{}' . \;

This should not copy the directories.


"I'm Winston Wolfe. I solve problems."

~ Need moar games? [arch-games] ~ [aurcheck] AUR haz updates? ~

Offline

#10 2009-06-30 16:14:11

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: sucking out mp3 files off ipods [Solved]

Mr Green wrote:

emmm its really really pulling the cycles....

wondering if B's command is recursively copying ?

the find command did not work it copys the dir too I just want the mp3 files out of F00 to F49

Thanks

MrG

It's a double match, so no - it will only copy stuff with 'mp3' at the end. Usually that's only files, if you happen to have directories called mp3... Bad mojo wink.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#11 2009-06-30 16:31:58

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: sucking out mp3 files off ipods [Solved]

Well full paths are the order of the day wink

Me pod decided to give up on me... lost my itunes database so no tracks show up yet they were still on device

Backed up... but then needed to extract them

Lost a few in the process of backing real painful got some errors

but still got near 3000 tracks saved

Now going to clean up ipod drive and start over

Thanks again for your help

No bad mojo here my friend lol

MrG


Mr Green

Offline

#12 2009-06-30 17:29:21

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: sucking out mp3 files off ipods [Solved]

You had problems with it before didn't you?

Dump that iPod and get some stuff from a company that actually values its clients... There's tons of good players around that don't force you to use their hardware on their terms.

I'm not meaning to start yet another flamewar, but I think you know yourself (and we all know here) that Cupertino's vendor lock-in can be as bad as Redmond's.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#13 2009-06-30 19:19:46

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: sucking out mp3 files off ipods [Solved]

This pod I got off the bay, case was fscked but drive was intact and had over 3000 tracks on it

Wanted to get tracks off before restore which wipes the drive

Tried Floola Yamipod Bansee Gtkpod [which is my fav!!!! pod app in linux] no dice drive was corrupt in some way

Anyway I backed up drive using rsync to me desktop loads of errors but needed to get tags etc back so had to transfer files [mp3 hence the thread] to a windows box [grrrrrr!!!!!] [[could have done it linux but was the easiest option at time]]

I was running Rockbox on the pod wink

Am open to suggestions on a different player, tried a few but they never quite matched up.

99% of the time I use linux with my pod and recently restored them from command line

Even got here a video ipod CF conversion lighter faster and uses less power

MrG


Mr Green

Offline

#14 2009-06-30 20:42:48

krolden
Member
Registered: 2009-06-30
Posts: 12

Re: sucking out mp3 files off ipods [Solved]

B wrote:

It's a double match, so no - it will only copy stuff with 'mp3' at the end. Usually that's only files, if you happen to have directories called mp3... Bad mojo wink.

just add -type f to the find command and it will skip those directories.

Offline

#15 2009-07-01 08:08:23

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: sucking out mp3 files off ipods [Solved]

Mr. Green: so Rockbox uses a database too? I understand it's handy for all kinds of metadata, but still...


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB