Hello all,

I have been having a bit of trouble with a script that is very easy to
develop in ksh.  I am just trying to rotate logs.

some of the variables I declare are:
        my $LOGDIR=/some/where/in/my/file/system/logdir;
        my $LOG=/some/where/in/my/file/system/logdir/logtorotate;

I have an array containing the name of the logs I want to rotate:
        my @alllogs=qw(log.0 log.1 log.2 log.3);

I want to accomplish the following:
I want to go to $LOGDIR (HOW DO I GO TO THAT DIRECTORY FROM MY SCRIPT W/OUT
USING A system(".....") call?)
and make sure that those files exist.  After that I want to     mv $log.2
$log.3
                                                        mv $log.1 $log.2
                                                        mv $log.0 $log.1
once again, how do I do this without using a system call (iff possible?).
                                      then,  I want to mv $LOG $log.0
                                      and lastly I want to clear the
contents of $LOG, (I would normally do cp /dev/null $LOG or
        
>$LOG) How do I do this in perl?

Any advice will be highly appreciated.

Yanet


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to