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
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