#1 2017-05-26 06:48:17

ancan
Member
Registered: 2017-05-26
Posts: 1

xsibackup-cron only runs when not redirecting output

Hi, and thanks to 33hops for providing a backup solution for us home tinkerers.

I have a issue with scheduled backup on my setup. I've installed xsibackup and cron on my ESXi 6.5 server, but the backup doesn't trigger at the schedules I've defined.

I've done all the steps in the troubleshooting section, and everything seems OK: the cron service is running, root crontab contains the correct entry (plus a pipe to "sed" which I guess have been added after the guide was written), and file permissions seem OK.

The strange thing is, I can get backup running if I execute "xsibackup-cron" myself, but if I redirect output to xsibackup-cron.log as is done in the crontab nothing happens and I just get back to the prompt again after  half a second or so. The log file is empty.

Grateful for any ideas how to get this working.

Offline

#2 2017-05-26 17:00:30

Daniel
Moderator
Registered: 2017-04-22
Posts: 60

Re: xsibackup-cron only runs when not redirecting output

Remove the bold part below at line 1071 to see output written to the log file in real time, sed buffers the output in ESXi 6.5.0, so it's written to the log file once the backup job finishes.

echo "/bin/kill \$(cat /var/run/crond.pid) && /bin/echo \"*/1 * * * * '${PWD}/xsibackup-cron' | sed '/\r/d' >> '${PWD}/xsibackup-cron.log' 2>&1\" >> /var/spool/cron/crontabs/root && /usr/lib/vmware/busybox/bin/busybox crond" >> /etc/rc.local.d/local.sh

Advice: remember not to use latest version of anything in production (ESXi 6.5.0), or you'll be tasting the Caesar's food.

Offline

Board footer