You are not logged in.
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
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
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
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
Globbing ftw .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
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)
--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
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
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
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
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 .
Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy
Offline
Well full paths are the order of the day
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
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
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
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
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 .
just add -type f to the find command and it will skip those directories.
Offline
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