指定开始和结束日期循环的shell脚本
#!/bin/sh
#riqizizeng
datebeg=$1
dateend=$2
#read datebeg
#read dateend
beg_s=`date -d "$datebeg" +%s`
end_s=`date -d "$dateend" +%s`
while [ "$beg_s" -le "$end_s" ]
do
python /home/co_pecker/code/pecker_script/src/migratedata/synusersdata.py synusersdata $(date -d @$beg_s+"%Y-%m-%d")
beg_s=$((beg_s+86400))
done
#riqizizeng
datebeg=$1
dateend=$2
#read datebeg
#read dateend
beg_s=`date -d "$datebeg" +%s`
end_s=`date -d "$dateend" +%s`
while [ "$beg_s" -le "$end_s" ]
do
python /home/co_pecker/code/pecker_script/src/migratedata/synusersdata.py synusersdata $(date -d @$beg_s+"%Y-%m-%d")
beg_s=$((beg_s+86400))
done