Re: File Copy

From: James J (SPAMMYjajii1_at_netscape.net)
Date: 05/08/03


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



Relevant Pages

  • Re: finding a fax in the fax console?
    ... The command line is for the Open command for TIF files. ... > I am still unable to view any faxes from the console. ... >>>>Inbox to the Outlook Inbox. ...
    (microsoft.public.outlook.fax)
  • RE: DLL error prevents me from using Windows...please help...
    ... I tried to open Rcovery Console through SAFE MODE W/ COMMAND ... I'm attempting the Recovery Console EXPAND feature, ... >> I don't have video on my motherboard. ...
    (microsoft.public.windowsxp.general)
  • Re: Which distro for a server?
    ... > everything that I need with only a text console. ... > that doesn't exactly help me in learning linux on my own. ... command line commands or names of configuration files - field-based editing ... me a virtually seamless full screen linux GUI. ...
    (comp.os.linux)
  • Re: cmdEX.exe - augmenting the existing CMD.EXE
    ... interfaces to get to the edit buffer. ... the console could be redirected to a Unicode graphical shell. ... provide extended command line completion for the current context. ... given the current context, and a way of returning the appropriate options.. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Why isnt OMVS command integrated with ISPF?
    ... the operator never needs to press ATTN before entering a command. ... you can now run a true z/OS console on a VTAM ... z/OS Unix session, if only to see how externalsbehaves under Unix. ...
    (bit.listserv.ibm-main)