Showing results for 
Search instead for 
Did you mean: 


The Data Agent generates logs every day and over time this can cause a disk space issue if not properly managed.

The following Linux script was developed to automatically compress log files older than 7 days and delete archived logs older than 30 days.

Steps needed

  1. Uncompress the attached script on the DataAgent server
  2. Change the file to have execute permission using this Linux command:
    chmod 744​
  3. Edit the file using vi
  4. Edit the variable FULL_LOG_PATH to set the full path to the logs folder like the example below:
  5. If you need to edit the number of days being compressed you can edit the number 7 in the second line, if you need to edit the number of days until the deletion of the compressed logs, you can edit the number 30 in the 3rd line.
  6. Add a cronjob to run this every day by typing:
    crontab -e​
  7. Add the following line to have a corn job running everyday at 1 AM.
    0 1 * * * > 2>&1​

Best Practices Index
Best Practices

Just here to browse knowledge? This might help!

Version history
Last update:
‎07-05-2023 04:28 PM
Updated by: