版权声明:本文为博主原创文章,转载请附上博文链接! https://blog.csdn.net/liyyzz33/article/details/84398428
#!/bin/bash
last_month=$(date -d "$(date +%Y%m)01 last month" +%Y%m)
echo $last_month
cd /PTAH
file=$(ls -d $last_month*)
zip -qrv /log/bak/$last_month.zip $file