#!/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
shell-zip备份上个月的日志(目录)
最新推荐文章于 2025-03-24 17:14:09 发布
#!/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