-->
  • Recent Articles

    Script for cacti database Backup Cleanup

    Script for cacti database Backup Cleanup


    This small script can be used for multiple thing. I'm using this for our cacti DB backup cleanup.



    cacti


    #!/bin/bash
    #manas.tri@gmail.com
    #Script for cacti database Backup Cleanup
    SOURCE_DIR=/CactiDBBackup/db
    echo "Today is $(date)" >> /tmp/databaseBackupCleanup.log
    echo Database Backup Cleanup >> /tmp/databaseBackupCleanup.log
    find $SOURCE_DIR -ctime +28 -exec ls -l {} \; >> /tmp/databaseBackupCleanup.log
    find $SOURCE_DIR -ctime +28 -exec rm {} \; >> /tmp/databaseBackupCleanup.log

    No comments