This article talks about automatically deleting the nightly backup files form Airwave server such that at any given time only two backups would be present instead of default 4.
Please SSH to the Airwave box and follow the below steps.Step1: Type the below command.[root@localhost mercury]# crontab -eu root[Now press letter “i” from the keyboard. Added the below lines in bold based on the nightly maintenance starting time. Since the nightly maintenance starts at 04:15 ( default) in the morning, we are deleting the old nightly backups on the AMP server before the nightly maintenance starts and we always maintain only two backups after every day nightly maintenance.]-----------------------------------------------------------------------# BEGIN AMP CRON ENTRIES15 04 * * * /usr/local/airwave/bin/nightly_maintenance_exclusive /usr/local/airwave/bin/nightly_maintenance# END AMP CRON ENTRIES00 04 * * * rm -rf /var/airwave-backup/nightly_data002*--------------------------------------------------------------------------NOTE: Please make sure that we paste the additional lines ( In Bold Italics) after the "# END AMP CRON ENTRIES".[Now press keys “ESC “ then “:wq “ and hit “ ENTER “ key.]Step 2: Restart the crond service using the below commands.[root@localhost mercury]# service crond restartStopping crond: [ OK ]Starting crond: [ OK ][root@localhost mercury]# chkconfig crond onAfter doing these changes every day we will be seeing only two backups in the /var/airwave-backup/ directory.Step 3: Navigate to backup directory and manually delete the 3rd and 4th backup files.# cd /var/airwave-backup/# rm -rf nightly_data003.tar.gz# rm -rf nightly_data004.tar.gz
© Copyright 2024 Hewlett Packard Enterprise Development LPAll Rights Reserved.