Simple Bash Script to Cleanup ASM Config Files

Posted by Kedar Bhatia on November 27, 2025 · 1 min read

Simple Bash shell script to cleanup ASM config files

In F5 Active/Standby setup I came across /var getting filled up often. Below command gives top 10 files consuming space on /var partition


find /var -xdev -type f -exec du -hs {} \; | sort -rn | head -10

Disk almost full from ASM sync files
/var partition filled with old ASM config sync files

Top 10 biggest files on /var
Output of find /var -xdev -type f -exec du -hs {} \; | sort -rn | head -10

Seemed like ASM config files took up too much space. rm -rf var/ts/var/sync/sync_*_full_update , as described here –https://my.f5.com/manage/s/article/K03345470 works just fine, but bash script for removal of files is better.

A simple log file keeps the history of files and deletions

Install & run in one line

```bash curl -Ls https://raw.githubusercontent.com/your-username/your-username.github.io/main/scripts/my-script.sh | bash