Search code examples
cronjelasticvirtuozzo

Cron Job Log File on Jelastic Virtuozzo


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.


Solution

  • 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.