Pls HELP on my script ...

Pls HELP on my script ...

Post by ?i ·s?_?q???é » Fri, 21 May 1999 04:00:00



Hi,

  I am writing a UNIX KSH script to cpio some dir+files into a tape.
Here are some background.

  I have to cpio (backup) :

  /data/team1/team1.dat/*
  /data/team2/team2.dat/*
  :
  :
  /data/teamn/teamn.dat

  You will say it is easy but I don't want to go down to team1.dat and
start the cpio.  All I want the script to do is :

  cd /data/team1
  find team1.dat -print | cpio ...

  then

  cd /data/team2
  find team2.dat -print | cpio ...

  then loop until teamn

Any suggestion ?

TH

 
 
 

Pls HELP on my script ...

Post by ·s?_?q?? » Fri, 21 May 1999 04:00:00



Hi,  

  I don't want to mislead anybody.  You may think that in this
case, I can use a loop counter.  Sorry to tell you that the case
should be

  /data/abc/abc.dat
  /data/xyz/xyz.dat
  /data/foo/foo.dat

  I have to backup from the second level ie

  /data/abc  find ..
  data/xyz  find ..

TH

: Hi,

:   I am writing a UNIX KSH script to cpio some dir+files into a tape.
: Here are some background.

:   I have to cpio (backup) :

:   /data/team1/team1.dat/*
:   /data/team2/team2.dat/*
:   :
:   :
:   /data/teamn/teamn.dat

:   You will say it is easy but I don't want to go down to team1.dat and
: start the cpio.  All I want the script to do is :

:   cd /data/team1
:   find team1.dat -print | cpio ...

:   then

:   cd /data/team2
:   find team2.dat -print | cpio ...

:   then loop until teamn

: Any suggestion ?

: TH

--
< s?_?q??? >
------------
URL : http://www.glink.net.hk/~tristan (A-mei)
URL : http://www.glink.net.hk/~taiwan (PowerStation)

 
 
 

Pls HELP on my script ...

Post by Ken Pizzi » Fri, 21 May 1999 04:00:00



Quote:>  I am writing a UNIX KSH script to cpio some dir+files into a tape.
>Here are some background.

>  I have to cpio (backup) :

>  /data/team1/team1.dat/*
>  /data/team2/team2.dat/*
>  :
>  :
>  /data/teamn/teamn.dat

>  You will say it is easy but I don't want to go down to team1.dat and
>start the cpio.  All I want the script to do is :

>  cd /data/team1
>  find team1.dat -print | cpio ...

>  then

>  cd /data/team2
>  find team2.dat -print | cpio ...

>  then loop until teamn

>Any suggestion ?

cd /data
for d in *; do
  cd $d
  find $d.dat -print | cpio ...
  cd ..
done

                --Ken Pizzini

 
 
 

1. Two perl scripts, MakeBootDisk.pl and Rescue.pl I would like to develop

I have two perl scripts that in a primitive form which I would like to
develop. The problem is, they work fine for me and I don't have time to
make them much more sophisticated. I would like to get them converted
into Perl 5.0 object oriented code, make it more user friendly, add
fail-safe checks, and make it more flexible.

BOTH OF THESE ARE BETA!!! You take your own chances using them!!

On perl Script, MakeBootDisk.pl, trys to grab your boot kernel
and put it on a floppy disk. Then you can boot from that floppy disk
in case something bad happens to your hard drive.

It is at
http://linux.med.ohio-state.edu/nielsen/MakeBootDisk.html

The second script is more useful, but needs a lot of work to make it
clean cut. It is called Rescue.pl. It makes a boot and root disk for
you so. The boot and root disks creates a virtual filesystem in ramdisk.

This will boot Linux on ANY ibm pc compatible computer. You don't need
your root partition on your hard drive working in order to get Linux
booted since it uses your second floppy disk, the root disk, as its root
filesystem.

Anyways, I would like to get it written in Perl 5.0 object oriented
code. Plus I would like it to get it to autodetect a lot of variables
and have fail-safe checks in there to minimize accidents.

It is at

http://linux.med.ohio-state.edu/nielsen/rescue.html

If people could work with me on this and improve the scripts, I would
most grateful. I did most of the hard work, now the tedious work needs
to be done. I make the scripts freely available and you can copy them
as much as you want and distribute them for non-profit purposes. There are
no warranties or gaurantees. Use at your own risk.

Mark
--
-----------------------------------------------------------------------------
Mark Nielsen at Prior Health Sciences Library at The Ohio State Univserity
http://linux.med.ohio-state.edu   http://auto.med.ohio-state.edu

2. Magneto-Optical drive on sco5

3. ksh:floating point addition wont work - pls help me fix my script!

4. Sunray FAQ?

5. Pls help: local mailer (Perl script) problem

6. serial ports

7. pls help with script optimization (short)

8. problem with compiling nn

9. pls help re: executing cgi scripts in html & apache conf.

10. OpenBSD firewall Install Script - pls help flesh it out

11. simple shell script-pls help

12. newbie starting with bash scripting - pls help

13. HELP: perl script runs differently as .pl and .cgi