Reply
Thread Tools
Posts: 13 | Thanked: 5 times | Joined on Feb 2006 @ Oregon
#1
I am trying to write a simple file copy command in xterm [find /./media/usb/sda1/dcim -name '*.JPG' | cpio -p /./media/mmc2/images] and received the message "sh: cpio: not found". Typing /bin/busybox without arguments gave me a listing of all command line "commands" available. The command "cpio" was not on the list. Why is the command "cpio" not available in this version of the Nokia IT's operating system (OS2008)? Is it available and am I just missing something or entering the syntax of the file copy command incorrectly?

I have a need to copy specific file types in multiple directories on my camera's CF memory card to a specific directory on my IT's SD memory card. The tablet is set to host mode and I can read all of the media devices correctly. I can list all of the files at /./media/usb/sda1/dcim and at /./media/mmc2/images to see what is in each directory. The "find" command works to list (print) the files that I need from the multiple directories on the CF memory card. I am just getting hung up with the lack of "cpio" in the command set.

Anyone have an idea on how to get the command "cpio" working on my N800 with the latest OS2008? If not, can someone suggest another way to copy the files from multiple directories on the CF memory card to one directory on the SD memory card in the tablet? Preferably without writing an entire shell script and without having to manually select files using File Manager!

Many thanks for your help.

Steve
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
 
Posts: 422 | Thanked: 244 times | Joined on Feb 2008
#3
What aspect of cpio do you need? The ability to swap cards when full?

If you just need to pass the filenames, you could use xargs and cp

find . -name "*.JPG" -print0 | xargs -0 -i cp {} /media/mmc2/images

Hmm... does the n810 have xargs?
 
Posts: 13 | Thanked: 5 times | Joined on Feb 2006 @ Oregon
#4
qwerty12 - I am not sure that this .deb binary you suggest will work with the N800 running OS2008. Can you confirm that installing this .deb will not change the existing function of the operating system or any installed applications? If not, I do not want to take the risk.

paulkoan - In my original post, I indicated that I am trying to copy files and not file names. Sorry, but I don't think your suggestion will do the job.

I thank the both of you for your quick replies!

Anyone else like to give a recommended method to my need to copy specified file types (pattern "*.JPG") from multiple directories on an external CF memory card to a single directory on the internal SD memory card? Preferably using one command line statement!

Thanks in advance.

Steve
 
Posts: 157 | Thanked: 96 times | Joined on Nov 2007 @ Oxford, UK
#5
Originally Posted by paulkoan View Post
What aspect of cpio do you need? The ability to swap cards when full?

If you just need to pass the filenames, you could use xargs and cp

find . -name "*.JPG" -print0 | xargs -0 -i cp {} /media/mmc2/images

Hmm... does the n810 have xargs?
Yes, it has xargs, but busybox xargs doesn't have -0 or -i arguments. This should work though:
find -name "*.JPG" | while read foo; do cp $foo /media/mmc2/images; done
 
Posts: 225 | Thanked: 68 times | Joined on Feb 2006
#6
sorry to butt in here, but I hoped you guys could help with a very simple (almost o topic) q - I'm still having trrouble moving/copying files as in that "themes/screenshot" thread, ie getting the modified background pngs from memory card into themes dir to replace original files.

been using EmelFM2 but getting "denied" result, changed to diff theme, root acces etc.

I'm at very early x term use, so can someone give me the command lines I'd need to copy these across?

cheers!
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#7
in xterm :
sudo gainroot
emelfm2

(instead of launching from menu)

if status bar says root and not user you should be able to copy files anywhere
 

The Following User Says Thank You to pipeline For This Useful Post:
Posts: 225 | Thanked: 68 times | Joined on Feb 2006
#8
thanks very much for that, sorted nicely, cheers!
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#9
Originally Posted by saklotz View Post
I am trying to write a simple file copy command in xterm [find /./media/usb/sda1/dcim -name '*.JPG' | cpio -p /./media/mmc2/images]
What with simply:
Code:
find /media/usb/sda1/dcim -name "*.JPG" -exec cp -p {} /media/mmc2/images/. \;
Or using tar:
Code:
cd media/usb/sda1/dcim  (or into whatever subdir holds the actual ".JPG" files)
tar cf - *.JPG | (cd /media/mmc2/images && tar xvf -)
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.

Last edited by TA-t3; 2008-03-12 at 12:42.
 
Posts: 157 | Thanked: 96 times | Joined on Nov 2007 @ Oxford, UK
#10
Originally Posted by TA-t3 View Post
What with simply:
Code:
find /media/usb/sda1/dcim -name "*.JPG" -exec cp -p {} /media/mmc2/images/. \;
Bzzt. Wrong answer. Busybox find doesn't have an exec option.

That was the first solution which occurred to me, but it doesn't work so you need something more complex like the while loop I posted (and tested first) or a tar pipeline.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 02:10.