recursive fcopy for the complete files directory?

Steffen Grunewald steffen.grunewald at aei.mpg.de
Thu Jun 2 09:31:39 CEST 2005


Hi Henning,

On Wed, Jun 01, 2005 at 10:19:56PM +0200, Henning Sprang wrote:
> Hi, 
> Maybe I miss something, but when I rename some files
> in /usr/local/share/fai/files, I always have to change the corresponding
> script that is responsible for copying this file to it's place.
> 
> Similar double-actions are required when adding or removing a file.
> 
> I would rather like to do a single fcopy command that makes sure every
> file in "files" gets copied to the install client according to matching
> class definitions, so I don't have to take care of anything else then.

I'm using a script to accomplish this which roughly looks this way:
(snipped and pasted)

# install all files available (using fcopy)

filelist=`cd /fai/files; find . -type f -print \
    | sed 's-^\./\(.*\)/.*-\1-' | grep -v 'CVS$' | grep -v '^packages' \
    | sort | uniq`

# ugly patch: remove /etc/resolv.conf
(cd /tmp/target/etc; /bin/mv -f resolv.conf resolv.conf.BAD)

for file in $filelist ; do
# -B: no backup files! would be included in conf.d directories :(
# -i: ignore "no matching class"
# [-M: default modes: would destroy executables]
# [-v: verbose output, only for debugging]
        fcopy -Bi $file
done


The resolv.conf thing is still in there from old days (dunno whether
it's still needed): fcopy would try to follow the symlink and replace
a file in the ro-mounted root.

If you're using SVN, you'd have to extend the find | grep a bit...

> Is something like that available? Or do I forget/oversee something which
> makes this a bad idea?

I've been doing this for quite a long time and nobody complained...
Note that some files would be fcopied before! 

Cheers,
 Steffen

-- 
Steffen Grunewald * MPI fuer Gravitationsphysik (Albert-Einstein-Institut)
SciencePark Golm, Am Mühlenberg 1, D-14476 Potsdam * http://www.aei.mpg.de
* e-mail: steffen.grunewald(*)aei.mpg.de * +49-331-567-{fon:7233,fax:7298}
No Word/PPT mails - http://www.gnu.org/philosophy/no-word-attachments.html



More information about the linux-fai mailing list