#!/bin/bash
#fmt as $1:date $2:command $3....

if [ -z "$1" ]; then
    echo "usage: $0 [lv0,lv1,...]";
    exit 1
fi
lvname=$1
mntpoint=`df-json | awk '/'$lvname'/ {print $8}'`
if [ ! -z "$mntpoint" ]; then
    echo [`date`] exec $0 >> /var/log/crond.log
    fstrim  "$mntpoint"
fi
#新增消息通知
ter_msg_add -c storage -l info -s notification -k ssdtrim_success
rm -r /tmp/volume/trim/${lvname}

exit 0
