#!/bin/bash
#
#site: www.jb200.com
update()
{
date_d=`date "+%Y-%m-%d"`
echo "$date_d" >>run_file
echo "update 完成,将日期写入run_file文件中(标记单天已运行过)"
}
run_check()
{
if [ -f run_file ];then
run_date=`
linuxjishu/13830.html target=_blank class=infotextkey>awk 'END {print$0}' run_file`
if [ $run_date = $date_d ];then
echo "$date_d已运行过一次,退出"
exit 0
else
echo "$date_d未有运行记录,调用update运行"
update
fi
else
update
fi
}
main()
{
run_check
}
main