gjcarneiro / yacron

A modern Cron replacement that is Docker-friendly
MIT License
449 stars 38 forks source link

correct way for curl command #69

Closed martadinata666 closed 1 year ago

martadinata666 commented 1 year ago

Description

Task marked fail but command success, im setting up to hourly download image for background override, the curl command is succes file downloaded correctly but yacron mark it as fail. Should i encapsulate with bash -c 'curl -L https://picsum.photos/3840/2160.jpg -o /var/www/html/public/img/bg1.jpg ?

heimdall_web.1.h28pgdlkajyr@homelab    | INFO:yacron:Starting job background-update
heimdall_web.1.h28pgdlkajyr@homelab    | INFO:yacron:Job background-update spawned
heimdall_web.1.h28pgdlkajyr@homelab    | [background-update stderr]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
heimdall_web.1.h28pgdlkajyr@homelab    | [background-update stderr]                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  607k    0  607k    0     0   186k      0 --:--:--  0:00:03 --:--:--  344k
heimdall_web.1.h28pgdlkajyr@homelab    | INFO:yacron:Job background-update exit code 0; has stdout: false, has stderr: true; fail_reason: 'failsWhen=producesStderr and stderr is not empty'
heimdall_web.1.h28pgdlkajyr@homelab    | INFO:yacron:Job background-update STDERR:
heimdall_web.1.h28pgdlkajyr@homelab    |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
heimdall_web.1.h28pgdlkajyr@homelab    |                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  607k    0  607k    0     0   186k      0 --:--:--  0:00:03 --:--:--  344k
heimdall_web.1.h28pgdlkajyr@homelab    | INFO:yacron:Cron job background-update: reporting failure
heimdall_web.1.h28pgdlkajyr@homelab    | INFO:yacron:Cron job background-update: reporting permanent failure

jobs definintion

jobs:
  - name: background-update
    command: curl -L https://picsum.photos/3840/2160.jpg -o /var/www/html/public/img/bg1.jpg
    shell: /bin/bash
    schedule: "0 * * * *"
tramdeholl commented 1 year ago

Hi @martadinata666 try it with curl -sS image

martadinata666 commented 1 year ago

use -sS work beautifully