Cron job stderr to email AND log file?

前端 未结 9 1621
离开以前
离开以前 2021-01-06 07:57

I have a cron job:

$SP_s/StartDailyS1.sh >$LP_s/MirrorLogS1.txt

Where SP_s is the path to the script and LP_s

9条回答
  •  抹茶落季
    2021-01-06 08:53

    If you can do with having stdout/err in separate files, this should do:

    ($SP_s/StartDailyS1.sh 2>&1 >$LP_s/MirrorLogS1.txt.stdout) | tee $LP_s/MirrorLogS1.txt.stderr
    

提交回复
热议问题