I receive 2 WP-CLI Auto Update emails with same body. Diff: Code (Text): < Restarting nginx (via systemctl): [ OK ] --- > Restarting nginx (via systemctl): [ OK ]^M Code (Text): < From: "(Cron Daemon)" <root@server.domain.tld> --- > From: admin@email.addr Code (Text): < Subject: Cron <root@hostname> sleep 218s ;/root/tools/wp_updater_${VHOSTNAME} 2>/dev/null --- > Subject: Wordpress WP-CLI Auto Update Tue Oct 18 16:03:45 UTC 2016 Bug or feature? 123.09beta01
that's weird check your cronjobs if there are not duplicates listed list cronjobs Code (Text): crontab -l edit cronjobs via nano text editor Code (Text): crontab -e save and exit nano type CTRL+X
no problem with duplicates. First email from cron: Code (Text): Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: <XDG_SESSION_ID=8061> X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0> X-Cron-Env: <LANG=en_US.UTF-8> X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/root> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=root> X-Cron-Env: <USER=root> Second email from script? Code (Text): User-Agent: Heirloom mailx 12.5 7/5/10
Yes, second email from script: Code (Text): cat -v /home/nginx/domains/_______/log/wp_updater-${DT}.log | /usr/bin/tr -cd '\11\12\15\40-\176' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | dos2unix | mail -r $EMAILFROM -s "Wordpress WP-CLI Auto Update $(date)" $EMAIL
ah i believe need to silence the cronjob script itself so change Code (Text): sleep 218s ;/root/tools/wp_updater_${VHOSTNAME} 2>/dev/null to Code (Text): sleep 218s ;/root/tools/wp_updater_${VHOSTNAME} >/dev/null 2>&1