日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

定时下载快速精密星历

發(fā)布時間:2023/12/9 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 定时下载快速精密星历 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

采用linux的計劃任務(wù)工具cron。

簡單用法:

參考http://yaksayoo.blog.51cto.com/510938/162062/

1、查看當前用戶的計劃任務(wù)

crontab -l

2、添加或編輯計劃任務(wù)

crontab -e

-----------------------------------------------------------

它的命令 采用 5個執(zhí)行時間參數(shù),然后是執(zhí)行的命令

5個時間參數(shù):

5個字段對應(yīng)的含義如下:
? * ? ? ???*??????? *????? ? *????? ? *
分鐘???? 小時?? 日期?? 月份??? 星期

------------------------

例如:

01 4-23/6 * * * csh /home/zhao/programs/gamit104/cron.sp3u > /dev/null 2>&1

這條計劃任務(wù)的含義是:

每天的UTC 3:01, 9:01, 15:01, and 21:01 執(zhí)行?cron.sp3u命令,并把命令輸出到無底洞。

------------------?cron.sp3u文件內(nèi)容如下-----------------

#!/bin/csh -f
# 6-hourly cron to download IGS ultra-rapid orbits from cddis
# The cron should run UTC 3:01, 9:01, 15:01, and 21:01
# Cron below is for Boston daylight savings time (our crons
# ? run on local time). ?The script test for UTC time and?
# ? delays as needed).
# 01 4-23/6 * * * csh /home/zhao/programs/gamit104/cron.sp3u > /dev/null 2>&1
#
set sp3_dir = /home/zhao/work/RealTime/sp3_files
#
cd $sp3_dir >&! /dev/null
if( ! -e cron_sp3u.log ) then
? echo `date` "Creating sp3 ultrapid download log" >! cron_sp3u.log
? echo "--------------------------------------------------------------" >> cron_sp3u.log
endif
#
# Get current UTC time?
set time = `date -u +"%Y %m %d %H %M"`
# Generate the name of sp3 file needed and see if we should
# wait for it to arrive (i.e., EST versus EDT).
set wait = `echo $time[4] | awk '{print int(($1-3)/6)*6-$1+3}' | awk '{if( $1 < 0 ) {print $1+6} else {print $1}}'`
#
# Generate the name of SP3 file needed
set wd = `doy $time[1] $time[2] $time[3]| head -2 | tail -n -1 | awk '{printf("%4d %d",$3,$7)}'`
# Normally $wait should 0 during EST and 1hr when EDT in effect (line below can have problems if delay is too long)
set sp3f = `echo $wd $time[4] $wait | awk '{if($3+$4-3 < 24 ) {printf("igu%4.4d%1d_%2.2d.sp3",$1,$2,$3+$4-3)} else {printf("igu%4.4d%1d_%2.2d.sp3.Z",$1,$2,$3+$4-3-24)}}'`
echo STATUS: `date +"%Y%m%d-%H%M"` : Getting $sp3f wait $wait hrs >> cron_sp3u.log


# See if we need to sleep
if( $wait > 0 ) then
? sleep ${wait}h
endif
# Try to download file from cddis
set pw = `whoami`@`hostname`
while ( ! -e ?$sp3f )
? ? ftp -ivn cddis.gsfc.nasa.gov <<! >&! /dev/null
user anonymous $pw
cd pub/gps/products/$wd[1]
ls $sp3f.Z
get $sp3f.Z
!
# ? Try to uncompress
? ? if( -e ?${sp3f}.Z ) then
? ? ? ?uncompress ${sp3f}.Z
? ? else
? ? ? ?echo STATUS: `date +"%Y%m%d-%H%M"` : Getting $sp3f wait 1 minute >> cron_sp3u.log
? ? ? ?sleep 1m
? ? endif
end
#
# Thats all

總結(jié)

以上是生活随笔為你收集整理的定时下载快速精密星历的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。