now=`date '+%Y-%m-%d %H:%M:%S'`echo ${now}yesterday1=`date -d yesterday +%Y-%m-%d`echo ${yestoday1}yesterday2=`date '+%Y%m%d' -d '-1 days'`echo ${yestoday2}tar zcvf ms_${yestoday2}.tar.gz *${yestoday1}.txt
本文共 253 字,大约阅读时间需要 1 分钟。
now=`date '+%Y-%m-%d %H:%M:%S'`echo ${now}yesterday1=`date -d yesterday +%Y-%m-%d`echo ${yestoday1}yesterday2=`date '+%Y%m%d' -d '-1 days'`echo ${yestoday2}tar zcvf ms_${yestoday2}.tar.gz *${yestoday1}.txt
转载于:https://www.cnblogs.com/linn/p/4287530.html