英文:
Cron Job Log File on Jelastic Virtuozzo
问题
I have a syntax to create a cron job every 2 minutes:
*/2 * * * * wget -q -O /var/www/webroot/ROOT/cron_log https://someweb.com/dev/api/order/cron-get-order
But no log file is created/updated. For information: the log is created before at var/www but it came messy because it created so many file log in that folder, so I want to make it neat.
英文:
I'm trying to create a log file for cron job on my jelastic/virtuozzo platform. I have a syntax to create a cron job every 2 minutes:
*/2 * * * * wget -q -O /var/www/webroot/ROOT/cron_log https://someweb.com/dev/api/order/cron-get-order
But no log file is created/updated. For information: the log is created before at var/www but it came messy because it created so many file log in that folder, so I want to make it neat.
答案1
得分: 1
./var 的原因是什么?
我怀疑你的问题是因为你没有使用完整路径到 wget(尝试使用 /usr/bin/wget 代替)
此外,由于你使用了 wget -q,也许你没有任何输出可以追加?
wget --help 摘录:
记录和输入文件:
  -o,--output-file=FILE    记录消息到FILE。
  -a,--append-output=FILE  追加消息到FILE。
  -d,--debug               打印大量的调试信息。
  -q,--quiet               静音(没有输出)。
  -v,--verbose             冗长(这是默认值)。
  -nv,--no-verbose          关闭冗长,但不静音。
       --report-speed=TYPE   输出带宽作为TYPE。TYPE可以是位。
  -i,--input-file=FILE     下载在本地或外部FILE中找到的URL。
  -F,--force-html          将输入文件视为HTML。
  -B,--base=URL            解析HTML输入文件链接(-i -F)
                             相对于URL。
       --config=FILE         指定要使用的配置文件。
英文:
Why ./var ?
I suspect that your problem is because you're not using the full path to wget (try /usr/bin/wget instead)
Also, since you're using wget -q, perhaps you don't have any output to append?
wget --help excerpt:
Logging and input file:
  -o,  --output-file=FILE    log messages to FILE.
  -a,  --append-output=FILE  append messages to FILE.
  -d,  --debug               print lots of debugging information.
  -q,  --quiet               quiet (no output).
  -v,  --verbose             be verbose (this is the default).
  -nv, --no-verbose          turn off verboseness, without being quiet.
       --report-speed=TYPE   Output bandwidth as TYPE.  TYPE can be bits.
  -i,  --input-file=FILE     download URLs found in local or external FILE.
  -F,  --force-html          treat input file as HTML.
  -B,  --base=URL            resolves HTML input-file links (-i -F)
                             relative to URL.
       --config=FILE         Specify config file to use.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论