Re: dbm-file versions

2004-09-09 Thread Chad Kellerman
Johann, I have had the same problem. Check, I bet the versions of Berkley DB are different. Chad Johann Spies wrote: We have a situation that we need to open a dbm-file but cannot do so using perl version 5.8.4-2 on Debian Sarge. The following script fails, but the same script and dbm-file

Re: 1 liner question

2004-02-25 Thread chad kellerman
the values and add them together, but I can't seem to get it right. But I did not realize this is not an "appropriate" topic for this mailing list. I apologize for that.. Anyways, thanks for the help. Chad On Wed, 2004-02-25 at 14:55, WC -Sx- Jones wrote: > chad kellerman

1 liner question

2004-02-25 Thread chad kellerman
Hello everyone... I am working on a perl one liner for adding quota on multiple partitions. But I can not, for the life of me get the number to add up.. Here is what I have: /usr/bin/quota michele | perl -ne 'if(/none$/){print "9\n"}elsif(m:^\s+/dev/:){($q, $l)=(split(/\s+/))[2

reading a httpd.conf file

2004-01-23 Thread chad kellerman
Hello everyone, I have a little issue that I am sure someone has come across here once before and was wondering if I can get some pointers. I am trying to read and grab values from a "messy" httpd.conf file. What I am trying to do is grab the ServerName value and DocumentRoot value for

the file is there.. I know it is.

2004-01-16 Thread chad kellerman
Hello everyone, I am starting to work on a script that is going to process a few files in some users directories. I thought I would do some checking on the file to make sure they are there and to make sure they are really files. I thought it was going to be pretty straight forward, until I ran

Archive::Tar a directory?

2003-11-05 Thread chad kellerman
Hello, I am writing a program that backups up databases. I am having trouble tarring up the directories. Tarring files using Archive::Tar is pretty straight forward, but tarring directories, I am having issues: here is part of the code.. $datadir = "/var/lib/mysql/"; $dbQuery = qq(

easier way to search and append in a file?

2003-10-16 Thread chad kellerman
Hey guys, I know you can do one a liner that appends a string after line in a file: ie: perl -p -i -e 's/$oldsting/$1\n$nextline/' file.txt But I was doing it in a script: #!/usr/bin/perl use strict; my $conf = "/home/bob/my.cnf"; my $string = "mysqld]"; my $replace = "bob was here"; open

Re: finding a spot in a file

2003-10-10 Thread chad kellerman
John, Thanks that was perfect.. Chad On Fri, 2003-10-10 at 03:11, John W. Krahn wrote: > Chad Kellerman wrote: > > > > Hello, > > Hello, > > >I am opening up a file (actually a my.conf). I only want 2 lines in > > the file. port and datadir

finding a spot in a file

2003-10-09 Thread chad kellerman
Hello, I am opening up a file (actually a my.conf). I only want 2 lines in the file. port and datadir The problem I am running into is that there is a port = 3324 in both the [client] section and the [mysqld] section. I want to open the file and go straight to the [mysqld] section and

Re: LABELS, forks and foreach loops.....

2003-03-27 Thread chad kellerman
f for the line that says: f( $pid > 0 ) { Not too sure what to make of it?? Thansk for the help CHad On Thursday 27 March 2003 11:59 am, Rob Dixon wrote: > Hi Chad. > > Chad Kellerman wrote: > > Hello, > > > >Got a little issue. Tyring ot under stand how thin

LABELS, forks and foreach loops.....

2003-03-27 Thread chad kellerman
Hello, Got a little issue. Tyring ot under stand how things work but just not getting it. I am forking each element of the array . I have a maximum child count of 8. Which works. What I was wondering is if I get into the if statement in the until loop. How do I exit the pid clean up a

Re: counting fork process, again

2003-03-25 Thread chad kellerman
h > help for you. What would work for me probably would not for you. > > Jenda > = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = > When it comes to wine, women and song, wizards are allowed > to get drunk and croon as much as they like. > -- Terry Pratchett in Sourcery

Re: counting fork process, again

2003-03-24 Thread chad kellerman
, Jenda Krynicky wrote: > From: chad kellerman <[EMAIL PROTECTED]> > > > Helloe everyone, > >I was wondering is someone can help me out with an issue with > >forking. I > > am trying to fork 8 process at a time. > > I did not read the previous thread. Di

counting fork process, again

2003-03-24 Thread chad kellerman
Helloe everyone, I was wondering is someone can help me out with an issue with forking. I am trying to fork 8 process at a time. Here is what I have: #!/usr/bin/perl use strict; use warnings; use lib "."; use BACKUP; #my own module use POSIX ":sys_wait_h"; my( $MAX_CHILDREN ) = "8";

next if........ a cleaner way?

2003-03-20 Thread chad kellerman
Hello everyone, I want to clean this bit of code up. It looks really messy. I am in a mental block. Any suggestions? @userInfo = split /\s+/, $buffer; #insert home users & quota in the db foreach $userInfo ( @userInfo ) { ( $name, $quota ) = split /\|/, $user

Use of uninitialized value in pattern match (m//) at test.pl line 85.

2003-02-01 Thread chad kellerman
tIt($server,$driveNum,%mslRef); }else{ my $driveNum = "1"; #MysqlIt($server,$driveNum,%mslRef); TestIt($server,$driveNum,%mslRef); } If /home2 is not returned from the ssh commnd I get the warning thanks in advance for the help. chad -- chad kellerman <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part

RE: Using ssh for uptime?

2002-12-10 Thread chad kellerman
Mark, This is a pain to install. I would do it thru CPAN. perl -MCPAN -e shell cpan>install Net::SSH::Perl I fyou don't have root access to install perl modules, try to use Net::SSH. use strict; use warnings; use Net::SSH qw( sshopen3 ); my $user = "bob"; my $host = "10.10.10.10"; my $

Re: Using ssh for uptime?

2002-12-07 Thread chad kellerman
Dammit, got the split wrong. try this: my ( $time, $uptime ) = ( split / /, $out[0] )[0,1]; my bad.. chad On Sat, 2002-12-07 at 12:11, Mark Weisman wrote: > I've got a script that I'm working on that will use SSH to check the > uptime on servers within my domain. However, I'm unsure of how

Re: Using ssh for uptime?

2002-12-07 Thread chad kellerman
Mark, It may be easier to go by route of the Net::SSH::Perl module or Net::SSH module #!/usr/bin/perl use strict; use warnings; my $user = "bob"; my @hosts = "host1, host2, host3, host3"; foreach my $host (@hosts) : my $cmd = "/usr/bin/uptime"; my $ssh = Net::SSH::Perl->new( $host, po

getting rid of STDOUT sometimes...

2002-12-02 Thread chad kellerman
stuff. Nad keep all the print statements in the scri[pt.. Can anyone offer any suggestions?? Thanks, --chad -- chad kellerman <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part

opendir questions

2002-11-20 Thread chad kellerman
is there. What else can I use for the "*" so that it will read the mail direcotry for a user? Thanks for the help, --chad -- chad kellerman <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part

RE: fork?

2002-11-14 Thread chad kellerman
== 0) { > #do some perl stuff >} > elsif($pid < 0) { > #do some other perl stuff >exit(0); > } > waitpid($pid,0); > > > Daryl J. Hoyt > Software Engineer > Geodesic Systems > 312-832-2010 > < http://www.geodesic.com> >

fork?

2002-11-13 Thread chad kellerman
Hey guys, I maybe misunderstanding what a fork can do, so I thought I would write in to verify. Because it doesn't appear to be doing what I want (think it should). I have a script that tars (unix) directories. I want the script to tar directories [a-n] as it is tarrring up [a-n] I want it

writing STDOUT while it's happening

2002-10-28 Thread chad kellerman
Hi guys, I have a piece of code that executes a command at a remote server and writes the output to stdout. It there a wat to write stdout as it is being written and not have to wait for it to be completed. I know it's kinda hard to understand but here is the portion of code: use Net::

to fork or not?

2002-10-22 Thread chad kellerman
te? I am think I have to fork the tar, but I am not too sure if this would be the best approach. thanks for the help. --chad -- Chad Kellerman Jr. Systems Administrator Alabanza Inc 410-234-3305 signature.asc Description: This is a digitally signed message part

a newbies attempt at cleverness are failing

2002-10-16 Thread chad kellerman
Hi everyone, I know there must be a easy way to do this but I just can't figure it out. I issue a command from a remote server and get a variable like so: my $out = 14G; # actually it's 14G\n I am trying to get just a numeric out oif it: I just want the 14: I have been tried a lot of things

Re: counter for hash

2002-10-15 Thread chad kellerman
japhy, you are correct. That it what I wanted to convey. But with everyone's input I understand what I was missing. thanks again, chad On Tue, 2002-10-15 at 12:59, Jeff 'japhy' Pinyan wrote: > On Oct 15, Rob said: > > >From: "chad kellerman" &l

counter for hash

2002-10-15 Thread chad kellerman
Hello, I wrote a script that goes thru the a access logs of a web server and prints out the hour and number of hits/hour. THe only problem is that if i use warnings I get a bunch of errors when I count the hits. Use of uninitialized value in addition (+) at scripts/hits.pl line 14, line 20

Re: cgi scripts and a crashing server:advice needed

2002-10-10 Thread chad kellerman
Videos & More > http://faith.yahoo.com > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Chad Kellerman Jr. Systems Administrator Alabanza Inc 410-234-3305 signature.asc Description: This is a digitally signed message part

checking email account name

2002-10-10 Thread chad kellerman
Hello again, I am using getOpts::Std, with a -e option where you have to emter in your email address. How can I do checking on that address. I am trying to verify the domain as well as the user. Here is what I have but I don't know how to contiue: getopts("d:s:e;h"); # colons take arg

Re: newbie problem with Getopts::Std

2002-10-10 Thread chad kellerman
My bad. I got it. I had getopts("ds:h"); and not getopts("d:s:h"); Sorry for posting something so stupid. chad On Thu, 2002-10-10 at 08:16, chad kellerman wrote: > Hi everyone, > Just started a little script I an am not too sure what I am doing > wong.

newbie problem with Getopts::Std

2002-10-10 Thread chad kellerman
Hi everyone, Just started a little script I an am not too sure what I am doing wong. I am just testing my opts to make sure they are what I want. Trying to maake a script "dummy prooof" Here is what I got: use Getopt::Std; our ($opt_h, $opt_d, $opt_s); if ($opt_h) { print "Usage: $0 -

removal of a line in a file

2002-10-09 Thread chad kellerman
Perl gurus, I was wondering if there is a one liner that searches a file for a string and then removes that line and the following four lines in the file? Thanks, Chad -- Chad Kellerman Jr. Systems Administrator Alabanza Inc 410-234-3305 signature.asc Description: This is a digitally

uptime

2002-10-03 Thread chad kellerman
Hi everyone, What would be the easiest way to find the uptime of a linux machine? I don't want to use a system call. Is there a module I can use? Or do I have to open /proc/uptime and calculate it thru there? Thanks for the help.. Chad -- Chad Kellerman Jr. Systems Administ

returning to parent after a fork.

2002-10-01 Thread chad kellerman
Hi, I was wondering if someone can shed some light on a problem I am having. I have a sub routine that forks each variable in an array one at a time. But after the last element in the array the program exists from the sub routine, it does not continue after the the last element in the arra

Re: fork exitting sub

2002-09-26 Thread chad kellerman
david, actually, without the while loop every user in the array gets forked at one time. 500+ forks. I put the while loop in and it does one at a time.. chad On Thu, 2002-09-26 at 14:28, david wrote: > Chad Kellerman wrote: > > > I have: > > > > foreach my $usr

RE: fork exitting sub

2002-09-26 Thread chad kellerman
> > > Is forking neccessary? Why not just check for the existence of the directory > and tar it up. > can you post the complete script? > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --

RE: fork exitting sub

2002-09-26 Thread chad kellerman
} > >waitpid($oUsrPid,0); > > } > > > > > > This is in a sub routine. But after it does stuff with $Usr it > > exists out of the sub and goes to the next one. IT does not contiue > > with the if (define @otherusers). > > THAT is because you code is telling it to that :-) > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Chad Kellerman Jr. Systems Administrator Alabanza Inc 410-234-3305 signature.asc Description: This is a digitally signed message part

fork exitting sub

2002-09-26 Thread chad kellerman
help. --chad -- Chad Kellerman Jr. Systems Administrator Alabanza Inc 410-234-3305 signature.asc Description: This is a digitally signed message part

Don't know how to title this email.

2002-09-24 Thread chad kellerman
Hello everyone, I am sure this is a newbie question but I have never had to do this in a script and I am not quite too sure if I can. Is there a way I can "mark" a part of a script so that, if I wrap an eval around a particular statement I can go back to that mark and retry it. I have t

Re: how to find memory leaks?

2002-09-20 Thread chad kellerman
Frank- I think he believes it's more of a security issue then anything else. We only have three os's here. Solaris x86, Solaris sparc, and linux. So I don't think it's a port issue. --chad On Fri, 2002-09-20 at 15:49, Frank Wiles wrote: > .--[ chad kellerm

RE: how to find memory leaks?

2002-09-20 Thread chad kellerman
to do that, especially using find.. -chad On Fri, 2002-09-20 at 15:01, david wrote: > Chad Kellerman wrote: > > > Dave, > > > > Actually in each fork. I was tarring up information from another > > server with Net::SSH::Perl. The full tar ball was written

RE: how to find memory leaks?

2002-09-20 Thread chad kellerman
? --chad On Fri, 2002-09-20 at 14:07, david wrote: > Chad Kellerman wrote: > > > > > here's my $.02 on this subject. Correct me if I am wrong. > > Once perl uses memory it does not want to let it go back to the system. > > I believe I have read the the dev

RE: how to find memory leaks?

2002-09-20 Thread chad kellerman
here's my $.02 on this subject. Correct me if I am wrong. Once perl uses memory it does not want to let it go back to the system. I believe I have read the the developers are working on this. Since you have your script running as a daemon. It will not release a lot of memory back to the syste

trying to get better with hashes

2002-09-19 Thread chad kellerman
Hello everyone, I think I am getting the hang of using perl, just rough around the edges. I was hoping you guys can give me a hand. Here is my issue. >From what I understand using global variables such as my #variable; it not the most "proper" way of coding. I ran into a problem that I ca

Re: Forking, Passing Parameters to forks

2002-09-19 Thread Chad Kellerman
Jason, I am using Parallel::ForkManger for a similar project. I works great except you cannot call a fork in a child process using the perl module. I actually had to use fork. But other then that it works great. chad On 19 Sep 2002 10:48:47 -0400 Jason Frisvold <[EMAIL PROTECTED]> wrote

sleep question

2002-09-12 Thread Chad Kellerman
Greetings, I have a script that forks 5 children. I print to screen when each child gets forked. Under certain conditions in the script a child should sleep. This conditions occurs at different times for each child. I think I am noticing that when the sleep is called in a child, ever

Re: a small forking problem.

2002-09-11 Thread Chad Kellerman
<[EMAIL PROTECTED]> wrote: > On Wed, Sep 11, 2002 at 12:17:55PM -0400, Chad Kellerman wrote: > > my @list = "bla, bla, bla, bla, bla"; > > You probably meant @list = ("bla", "bla", "bla", "bla", "bla"); > > &g

a small forking problem.

2002-09-11 Thread Chad Kellerman
Hey, I got a script that I use Parallel::ForkManager, which works great... the only problem is that I want a child to fork another process and Parallel::ForkManager does not allow that. So for my first fork I use it but in the child I am trying to use the normal oreilly FORK but I am missi

how to release memory

2002-09-10 Thread Chad Kellerman
Hello, I have a subroutine that declares a variable from standard out. If I just undef that variable will that free up the memory that it used? Or is there another command that frees up memory? THanks for the help --chad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

writing stdout to disk in chunks

2002-09-05 Thread Chad Kellerman
Hello, I am having issues with writing standardout to disk. ( in chunks) I have a small backup script that runs. It uses Net::SSH::Perl to send a tar command to the hoem directory of a server. The tar command pipes eveything to STDOUT, on the backend I write that STDOUT to disk. Everything

child processes dying...

2002-09-03 Thread Chad Kellerman
Hello Everyone, I got a script that spawns off a few children. But for some reason before the children are finished doing what they are suppose to do they die. code: use POSIX "sys_wait_h"; my $child_limit = 1; my $child_pids = 0; $SIG{CHLD} = \&CHILD_COUNT; FORK: {

perl ssh

2002-09-03 Thread Chad Kellerman
Hey guys, Having an issue with Net::SSH:Perl and eval. Is there another way to write this? Or am I just missing something? my $ssh; eval { alarm 10; $ssh = Net::SSH::Perl->new($host_ip, identity_files =>["$id_key_fn"

Re: eval on a $SIG{KILL}- newbie question

2002-08-27 Thread Chad Kellerman
ote: > > -Original Message- > > From: Chad Kellerman [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, August 27, 2002 8:58 AM > > To: [EMAIL PROTECTED] > > Subject: Re: eval on a $SIG{KILL}- newbie question > > > > > > Bob, > > Thanks f

Re: eval on a $SIG{KILL}- newbie question

2002-08-27 Thread Chad Kellerman
2 08:41:31 -0400 Bob Showalter <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: Chad Kellerman [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, August 27, 2002 8:33 AM > > To: [EMAIL PROTECTED] > > Subject: eval on a $SIG{KILL}- newbie question >

eval on a $SIG{KILL}- newbie question

2002-08-27 Thread Chad Kellerman
Hello, I am writing a script on a linux server use Net::SSH::Perl. Every once in a while the ssh connection to a remote server dies or it just can't connect. the perl module send a $SIG{KILL} to the script when ever this happens. Which isn't what I want. I am trying to put the kill in an e

Forking question.

2002-08-26 Thread Chad Kellerman
Good morning, afternoon, night, I have been trying to work on a script that does forking. But the script dies in the fork. Here is what I have: I push some information about a server into an array. use POSIX "sys_wait_h"; my $child_limit = 1; my $child_pids = 0; $SIG{CHLD} = \&CHILD_

newbie question

2002-08-19 Thread Chad Kellerman
Hello, I have only been writing perl for a few months, so forgive me if this sounds stupid. what is the difference between: $| = 1; and $|++; Or can you point me in the right direction on where I can read boutit? Thanks, Chad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Warning message I can't figure out

2002-08-17 Thread chad kellerman
Hey guys, I was working on a disk usage script. Mainly using stat like DAn had in an earlier posting. Buit when I saw Janek post I thought, "That's perfect, Just what I was doing but about 8 lines less." I incorporated it into my script but the waring message I can't figure out. I am kind

newbie question about Sys::Hostname and modules in general

2002-08-02 Thread Chad Kellerman
Hello, Ok, I made a newbie mistake and I hope I don't have to go back and change my code. I wrote a script that talks to a Mysql database. I created a table called hostname. I created a subroutine to send email messages when that is any errors as well as log them to the db. Problem is

Net::SSH::Perl

2002-07-29 Thread Chad Kellerman
Hello everyone, I am not too sure if this is the place to send this question or not, but here it goes anyway: I have a script that uses the Net::SSH::Perl modules for connecting to a server. I connect and grab all the databases and put them into an array. Latter in the script I run a f

Re: Remove 4 last letters

2002-07-23 Thread Chad Kellerman
Dave, I did it this way $variable = substr($orig_variable,0,length($orig_variable)-2); I actually only removed the last 2 characters but I don't see why you could not put a 4 and remove last four.. I am sort of new at perl but I did get the above to work. I needed to drop off 2 n

perl modules?

2002-07-15 Thread chad kellerman
Hello, Boy this stuff can get frustrating I am trying to include my own perl module that is outside the regular @INC array. But my perl script still can not find it.. Any suggestions would be appreciated... Here is what I have... script.pm package Script; BEGIN { use Expo

Fork to run a sub -process

2002-07-12 Thread chad kellerman
Hi everyone, I am stuck. I have a perl script that I wrote. It runs on a Solaris 8 box and goes out to linux boxes and tars up user data and mysql data and stores it on particular drives of the sun box. Right now the script only goes out and tars up one server at a time. I was think

Re: Backup script using other modules.

2002-05-14 Thread chad kellerman
se z as part of your tar command? (E.g. tar zcpf) no - > in the command. > > Regards, > Jaimee > > -----Original Message- > From: chad kellerman [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 14, 2002 7:14 AM > To: [EMAIL PROTECTED] > Subject: Backup scrip

Backup script using other modules.

2002-05-14 Thread chad kellerman
Hello everyone, I am a little new to perl. I am writing a little backup script using Net::SSH:Perl, Compress::Zlib and FileHandle. I am just tarring up users in the home directory. ( Ohh I am runnng Linux) I have most of the script working except Compress standard out from my ssh comman