Amanda-Users

Re: moved to new disk, now amanda wants to do level 0's on whole system

2003-11-14 12:43:42
Subject: Re: moved to new disk, now amanda wants to do level 0's on whole system
From: Jon LaBadie <jon AT jgcomp DOT com>
To: amanda-users AT amanda DOT org
Date: Fri, 14 Nov 2003 12:41:01 -0500
On Fri, Nov 14, 2003 at 05:26:26PM +0100, Christopher Odenbach wrote:
> 
> Hi,
> 
> > The times reported by an ls -l seem to be sane, and of those perms I
> > checked, they were preserved ok.  The major hiccup I had was that cp
> > doesn't do ".name" files
> 
> Of course "cp" does copy dot-files. I think you may have stumbled over 
> the shell asterisk.
> 
> If you say "cp -rp * /somewhere", the shell expands the "*" to all files 
> and dirs in that directory except those beginning with a dot!
> 
> Try "echo *" - you get a list of the files in the current directory but 
> without the dot files.
> 
> You may use "cp * .??*" as a workaround (.??* means all filenames that 
> begin with a dot but excludes ".." which would be too much), but that 
> won't cover files like ".a" or similar dot-and-one-letter filenames.
> 

If you really want/must to use cp, you can get all the entries
with the -A option of ls.  It is like -a except it omits the
"." and ".." directories.

   cp -rp `ls -A` dstdir   # or ksh/bash:  cp -rp $(ls -A) dstdir

Have to be done as root to preserve ids and permissions with the
"-p" option and as noted, does have a symlink problem.


-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)