Script for deleting log files in unix server - Aix

This is a discussion on Script for deleting log files in unix server - Aix ; Hi. I have a log directory with subdirectories that contain some logs file for which I am seeking assistance from anyone to help me out for a script to delete those log files that are older than 14 days in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Script for deleting log files in unix server

  1. Script for deleting log files in unix server

    Hi.

    I have a log directory with subdirectories that contain some logs file for which I am seeking assistance from anyone to help me out for a script to delete those log files that are older than 14 days in AIX env.
    I will also include this in a cronjob entry


    Many thanks

    Anth105

  2. Re: Script for deleting log files in unix server

    find ${LogDir} -atime +14 -exec ls -l {} \; > ${LogDir}/Delete.log
    find ${LogDir} -atime +14 -exec rm -f {} \;

+ Reply to Thread