shell-zip备份上个月的日志(目录)

版权声明:本文为博主原创文章,转载请附上博文链接! 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

猜你喜欢

转载自blog.csdn.net/liyyzz33/article/details/84398428
今日推荐