I seem to recall that the backup API only backs up to that server's local drive, not the local drive that your script is running on. So the "C:\\mike\\$myServer\\$eventLog" folder may need to pre-exist on the remote system. Does this ring a bell to anyone?
-----Original Message----- From: Glenn Meyer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 4:33 PM To: [EMAIL PROTECTED] Subject: Win32::EventLog I need a little help with the libwin32 Win32::EventLog module, please. My version of libwin32 is 0.18 My version of Perl is 5.6.1 build 531 on Windows 2000 Pro. Using the example #2 script right off of the CPAN documentation page http://theoryx5.uwinnipeg.ca/CPAN/data/libwin32/EventLog/EventLog.html and changing only the servername and the path... --------------------------------------------------------------- #!c:\perl\bin\ use Win32::EventLog; $myServer="\\\\karen2"; my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4])); my($dest); for my $eventLog ("Application", "System", "Security") { $handle=Win32::EventLog->new($eventLog, $myServer) or die "Can't open Application EventLog on $myServer\n"; $dest="C:\\mike\\$myServer\\$eventLog\\$date.evt"; $handle->Backup($dest) or warn "Could not backup and clear the $eventLog EventLog on $myServer ($^E)\n"; $handle->Close; } ---------------------------------------------------------------- I get only... Could not backup and clear the Application EventLog on \\karen2 (The parameter is incorrect) Could not backup and clear the System EventLog on \\karen2 (The parameter is incorrect) Could not backup and clear the Security EventLog on \\karen2 (The parameter is incorrect) Any thoughts? Running with -w gives me... Use of uninitialized value in pattern match (m//) at C:/Perl/site/lib/Win32/EventLog.pm line 72. Use of uninitialized value in subroutine entry at C:/Perl/site/lib/Win32/EventLog.pm line 72. Could not backup and clear the Application EventLog on \\karen2 (The parameter is incorrect) Use of uninitialized value in pattern match (m//) at C:/Perl/site/lib/Win32/EventLog.pm line 72. Use of uninitialized value in subroutine entry at C:/Perl/site/lib/Win32/EventLog.pm line 72. Could not backup and clear the System EventLog on \\karen2 (The parameter is incorrect) Use of uninitialized value in pattern match (m//) at C:/Perl/site/lib/Win32/EventLog.pm line 72. Use of uninitialized value in subroutine entry at C:/Perl/site/lib/Win32/EventLog.pm line 72. Could not backup and clear the Security EventLog on \\karen2 (The parameter is incorrect) Line 72 of C:/Perl/site/lib/Win32/EventLog.pm is the "if" line of the sub new ... sub new { die "usage: PACKAGE->new(SOURCENAME[, SERVERNAME])\n" unless @_ > 1; my ($class,$source,$server) = @_; my $handle; # Create new handle if (my $source !~ /\\/) { OpenEventLog($handle, $server, $source); } else { OpenBackupEventLog($handle, $server, $source); } return bless {handle => $handle, Source => $source, Computer => $server} => $class; } Any ideas?? Many thanks! Glenn _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
