Send stdout and stderr in logs, but print stderr also

So a failed cron job will be emailed to the admin
tags/smeserver-letsencrypt-client-0.2.4-1
Daniel Berteaud 9 years ago
parent 233c6e4945
commit 9163bbd3c3
  1. 2
      root/etc/e-smith/templates/etc/crontab/80letsencrypt

@ -4,7 +4,7 @@ my $le = $letsencrypt{'status'} || 'disabled';
if ($le eq 'enabled'){ if ($le eq 'enabled'){
$OUT .= '# Letsencrypt renewal' . "\n"; $OUT .= '# Letsencrypt renewal' . "\n";
$OUT .= '2 4 * * * root sleep $[ $RANDOM \% 3600 ]; /usr/bin/letsencrypt.sh -c >> /var/log/letsencrypt.sh.log 2>&1' . "\n"; $OUT .= '2 4 * * * root sleep $[ $RANDOM \% 3600 ]; { /usr/bin/letsencrypt.sh -c >> /var/log/letsencrypt.sh.log } 2>&1 | tee -a /var/log/letsencrypt.sh.log' . "\n";
} }
else{ else{
$OUT .= '# Letsencrypt is disabled' . "\n"; $OUT .= '# Letsencrypt is disabled' . "\n";

Loading…
Cancel
Save