【发布时间】:2026-01-18 14:55:02
【问题描述】:
我正在尝试创建一个每天收集天气模型数据的 shell 脚本。我计划使用 cron,但在将其放入 CRON 之前我正在测试我的 shell 脚本。我在命令行上尝试了我的 wget 命令,它工作正常。在以下脚本中尝试时:
#!/bin/bash
date_time=$(date +"%m%d%H%M")
FILE="gfs_wget_$date_time.txt"
file1="ftp://ftp.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.2014011618/gfs.t18Z.pgrb2bf09"
wget -o $FILE "$file1"
日志文件提供以下信息:
--2014-01-16 19:17:44-- ftp://ftp.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.2014011618/gfs.t18Z.pgrb2bf09
=> gfs.t18Z.pgrb2bf09'
Resolving ftp.ncep.noaa.gov... 140.90.101.180
Connecting to ftp.ncep.noaa.gov|140.90.101.180|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /pub/data/nccf/com/gfs/prod/gfs.2014011618 ... done.
==> SIZE gfs.t18Z.pgrb2bf09 ... done.
==> PASV ... done. ==> RETR gfs.t18Z.pgrb2bf09 ...
No such filegfs.t18Z.pgrb2bf09'。
任何帮助都会很棒。
WGET 版本 1.11.4 Linux 2.6.18-348.18.1.e15PAE i686
【问题讨论】: