Re: perl / ksh help

2002-10-25 Thread Matthew Seaman
On Fri, Oct 25, 2002 at 04:43:15AM +0200, rootjrs wrote:

 I know some one has already done this and I need a little help.  I have 
 two identical directories on two seperate machines.  The files were 
 moved over fromm machine a to machine b.  Everything is working 
 properly on machine b but all of the permissions were lost.
 
 I've done the following:
 
 (machine a)# find ./ -ls -print  perm.list
 
 Gave me the file listing and permisions
 
 (machine a)# cat perm.list | awk '{print $4, ,$11}'  newperm.list
 
 This removed garbage like date owners etc that I didn't need.
 
 Now I'm stuck with a file that looks like this:
 
 -rw-r--r--   ./data/dir/data/getme.bin.old
 -rw-rw-rw-   ./data/dir/data/stp.501
 drwxrwxrwx   ./data/dir/data/realgoodgold
 -rwsr-xr-x   ./data/dir/exe/help
 
 At this point I'm thinking great, now all I need is to create a perl or 
 shell script that converts the -rw-r--r--, etc into some sort of numerical value and 
then 
 do soemthing like this
 
 for
 chmod $1 $2
 done
 
 .using perl or ksh.  However I can't figure out how to do the 
 conversion correctly.  Please will one of you perl / ksh experts please 
 help me out.  

Instead of beating your brains out writing scripts to do this, simply
install ports/net/rsync.  Then synchronizing the file systems on the
two boxes is simple.  From the machine with the original copy of the
data:

rsync -avx --delete /path/to/data/dir/ other.machine.com:/path/to/data/dir/

This will copy the data from the original filesystem to the second one
using the minimum amount of network traffic possible.  

Nb. the trailing slashes on those paths are important.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
  Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: perl / ksh help

2002-10-25 Thread Jerry McAllister
 
 
  hi,
  
  I know some one has already done this and I need a little help.  I have 
  two identical directories on two seperate machines.  The files were 
  moved over fromm machine a to machine b.  Everything is working 
  properly on machine b but all of the permissions were lost.
  
  I've done the following:
  
  (machine a)# find ./ -ls -print  perm.list
  
  Gave me the file listing and permisions
  
  (machine a)# cat perm.list | awk '{print $4, ,$11}'  newperm.list
  
  This removed garbage like date owners etc that I didn't need.
  
  Now I'm stuck with a file that looks like this:
  
  -rw-r--r--   ./data/dir/data/getme.bin.old
  -rw-rw-rw-   ./data/dir/data/stp.501
  drwxrwxrwx   ./data/dir/data/realgoodgold
  -rwsr-xr-x   ./data/dir/exe/help

If you have the directory on mach a with the perms you want, then
why don't you just tar that dir up with the '-p' flag to preserve
permissions.   Then make the directory where you want it and untar 
it all, again using '-p' on the other machine .  
It should do what I think you might be saying here.

on mach a:
   cd /dir-you-want-to-move
   tar cvpf ../stuff.tar *

move tar file to mach b

on mach b:
   mkdir /where-you-want-stuff-to-go
   cd /where-you-want-stuff-to-go
   tar xvpf ./stuff.tar

voila!

jerry


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



perl / ksh help

2002-10-24 Thread rootjrs
hi,

I know some one has already done this and I need a little help.  I have 
two identical directories on two seperate machines.  The files were 
moved over fromm machine a to machine b.  Everything is working 
properly on machine b but all of the permissions were lost.

I've done the following:

(machine a)# find ./ -ls -print  perm.list

Gave me the file listing and permisions

(machine a)# cat perm.list | awk '{print $4, ,$11}'  newperm.list

This removed garbage like date owners etc that I didn't need.

Now I'm stuck with a file that looks like this:

-rw-r--r--   ./data/dir/data/getme.bin.old
-rw-rw-rw-   ./data/dir/data/stp.501
drwxrwxrwx   ./data/dir/data/realgoodgold
-rwsr-xr-x   ./data/dir/exe/help

At this point I'm thinking great, now all I need is to create a perl or 
shell script that converts the -rw-r--r--, etc into some sort of numerical value and 
then 
do soemthing like this

for
chmod $1 $2
done

.using perl or ksh.  However I can't figure out how to do the 
conversion correctly.  Please will one of you perl / ksh experts please 
help me out.  

SEcondly I have a perl script that calls:

use GIFgraph::lines

The maker is now saying to call GD::Graph instead of
GIFgraph 
(http://www.cpan.org/modules/by-module/GIFgraph/GIFgraph-1.20.readme).  
I need to re-engineer the script is there a tutorial on GD:Graph some 
where?

Thanks



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message