date
指令#!/bin/bash
yesd=$(date -v-1d +%Y%m%d)
for i in 0 1 2 3;do
ymd=$(date -v+${i}d -j -f "%Y%m%d" "${yesd}" +%Y%m%d)
y=$(date -v+${i}d -j -f "%Y%m%d" "${yesd}" +%Y)
ddd=$(date -v+${i}d -j -f "%Y%m%d" "${yesd}" +%Y-%m-%d)
for d in 1 3;do
fn=U10V10_d0${d}_${ddd}_06:00:00
# if ! [ -e /Users/Data/cwb/e-service/btraj_WRFnests/CWB_forecast/$fn ];then
cp /Users/Data/cwb/WRF_3Km/${y}/${ymd}/$fn /Users/Data/cwb/e-service/btraj_WRFnests/CWB_forecast/$fn
# fi
done
done
for d in $today $Tomorr $AftTmw;do
cd /Library/WebServer/Documents
for t in zhongshan zhongming jiayi qianjin;do
$PY -t $t -d ${d}12 -b True
fn=trj_results/btrj${t}${d}12_mark.csv
rm -f trj_results/today_$t.csv
if [ -e $fn ];then cp $fn trj_results/today_$t.csv;fi
done
...
test $d == $today && dir=00
test $d == $Tomorr && dir=p1
test $d == $AftTmw && dir=p2
cat header.txt today.csv > $dir/today_marks.csv
done
CJ=/opt/anaconda3/bin/csv_to_geojson
...
#geojson for leaflet-ajax
cat headLL2.txt today.csv > today${today}12.csv
$CJ today${today}12.csv
VI=/Users/kuang/bin/addVI.py
...
for dir in 00 m1 m2 p1 p2;do
cd $dir
$VI today_marks.csv
cd ..
done
git pull
)cd /Users/kuang/GitHub/sinotec2.github.io/traj/trj_results
for i in 00 m1 m2 p1 p2;do cp -r /Library/WebServer/Documents/trj_results/$i .;done
chmod -R o+r ??
cd /Users/kuang/GitHub/sinotec2.github.io
su kuang
GT=/usr/local/bin/git
$GT pull origin main
$GT add traj
$GT commit -m "update traj"
TOKEN=$(cat /Users/kuang/bin/git.token)
$GT push https://sinotec2:$TOKEN@github.com/sinotec2/sinotec2.github.io.git main
## trajectories update
#MIN HOUR DOM MON DOW CMD
0 4 * * * /Library/WebServer/Documents/trj_results/daily_traj.cs >& /Library/WebServer/Documents/trj_results/daily_traj.out