bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with cp (copy)


From: Mr. Phillip Kimble
Subject: Problem with cp (copy)
Date: Tue, 21 Jan 2003 18:45:50 -0600

Greetings,

I recently stumbled across a strange problem using cp which I do not
understand. Here is the scenario;

I desire to copy backup files in original format from one directory to
another. The source directory is layered and comprised of several
sub-directories based upon date;

01.01.01 = Jan 1, 2001
12.31.01 = Dec 31, 2001

Now, the intent is to not copy the directory structures but to mass all
files for a single month into a single directory, /home/user/admin/tamp/

Easy enough? The original command I used was

Cp -far /home/ftp/tmp/2001/01.*.01/* /home/user/admin/tmp/

All worked well for 01, 02, 03, 04, (Jan, Feb, Mar, & Apr). Once I
entered 05.*.01, I received the error, "Argument list is too long".
Actual command,

Cp -fa /home/ftp/tmp/2001/05.*.01/* /home/user/admin/tmp/

Now understand, the command worked perfectly as;
Cp -fa /home/ftp/tmp/2001/01.*.01/* /home/user/admin/tmp/
Cp -fa /home/ftp/tmp/2001/02.*.01/* /home/user/admin/tmp/
Cp -fa /home/ftp/tmp/2001/03.*.01/* /home/user/admin/tmp/
Cp -fa /home/ftp/tmp/2001/04.*.01/* /home/user/admin/tmp/

But once I changed the month to 05, it stopped and gave me the "Argument
list is too long" error. I ask, what is the difference between 04 and 05
in length?

I made /home/ftp/tmp/2001 as my current directory and adjusted the
argument to;
Cp -fa ./05.*.01/* /home/user/admin/tmp/

To shorten the argument list. No good, same error! If I remove the *
from the argument, it copies the files and directories just fine with no
errors. But this does not save time or effort, as I still have to mv the
files into the parent directory once copied.

Additionally, I am using Slackware Linux 8.1 with fileutils-4.1-i386 on
a Compaq Proliant 1850R server. I find this to be strange and have no
clue as to what to do to fix it.

Gratefully
Phil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]