Check out the File::Copy module. That will do what you want. Also, the stat() function will give you the file parameters, including size.
-----Original Message-----
From: Mario Ortiz [mailto:[EMAIL PROTECTED]
Sent: Monday, July 14, 2003 12:22 PM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] how to check log file, copy it and remove contains

Hi

 

I am kind of new to perl.

 

Can you tell me how I can write a perl script file where I can look in the /var directory for the log file and copy it to another server and than delete the contains of the log file. I would also like to check for any files larger than 200 mb in size in the /var directory.

 

We are using a Solaris 5.6 3000 server and the file will be copied to probably a windows server for save keeping for a short time only. The sun server has limited space at this time.

 

Thanks,

 

Mario

 

Reply via email to