Re: File Copy
From: James J (SPAMMYjajii1_at_netscape.net)
Date: 05/08/03
- Next message: Jim Rendant: "MYSQL configuration error"
- Previous message: Jean-Pierre Radley: "Re: Broadcom Gigabit NIC driver"
- In reply to: Abid Khan: "File Copy"
- Next in thread: Abid Khan: "Re: File Copy"
- Reply: Abid Khan: "Re: File Copy"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 8 May 2003 19:34:42 +0000 (UTC)
akhan@att.net (Abid Khan) expounded in
news:28fccfbb.0305060855.48a67a21@posting.google.com:
> Hello all,
>
> I am working on a OpenServer 5.0.5 fully patched system, I am copying
> bunch of file (all files start with A:) from one directory to another
> through a menu shell script, I am using cp /u/dir1/A:* /u/dir2,
> sometime it works fine other times it just hangs, I need to set this
> up so the client can use it through the menu to make a copy of the
> data set and then a third party software can use that data to do
> electronic transmission, any ideas why it is hanging, or someone can
> share a better command with me, I would really like to see if I can
> put a status bar or something to show the copy status, percetage done,
> etc.
>
> Thanks for your help..
>
> Abid
Hmm. Not sure why it would "hang". Are you sure it's not just taking a
long time? You don't get any kind of error message? If you're working on
a terminal and not at the console, have you looked for messages on the
console screen? If the destination filesystem ran out of space, the
command might seem to hang, but there should be "no space" messages on the
console.
There used to be a limit on the number of characters in an argument list
and a command with a wildcard could hit that limit if there were enough
files, but I think they increased or eliminated that limit in OSR 5.
Besides, if that was the problem, it shouldn't "hang". You should just get
an error (something like "arg list too long", as I recall).
Assuming you want to copy every file in /u/dir1, and every directory under
that, that started with "A:", I'd probably use cpio to copy the files.
Something like:
cd /u/dir1
find . -name "A:*" ! -type d -print | cpio -pvmd /u/dir2
If you don't want to include any files in sub-directories under /u/dir1,
there are ways to do that.
As for some kind of status display, the "v" option in that cpio command
will have it list the file names as it copies them. Will that do? It
might be possible to do something like a percentage display, but it
probably wouldn't be too easy.
If you'd rather not see the file names, just leave "v" out of the cpio
options.
Also, that command assumes that /u/dir2 does not already contain any files
with the same name. If you want cpio to overwrite files with the same
name, add "u" (eg. "cpio -pvmud /u/dir2").
Or maybe you want to delete everything in /u/dir2 before starting the
copy.
James
- Next message: Jim Rendant: "MYSQL configuration error"
- Previous message: Jean-Pierre Radley: "Re: Broadcom Gigabit NIC driver"
- In reply to: Abid Khan: "File Copy"
- Next in thread: Abid Khan: "Re: File Copy"
- Reply: Abid Khan: "Re: File Copy"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|