Hello, so I've written a script in Centos cron to create daily backups of certain folders, using tar.
My problem is, I can't seem to have tar write errors to a log file.
This is the relevant command sequence:
echo "*** Backup data DOM" > /tmp/log/dom.log
tar -cvpj /home/Archive/ | split -d -b 10240m - /tmp/dom/dom.tar 2>> /tmp/log/dom.log
echo "*** Backup completed" >> /tmp/log/dom.log
I have tried renaming the Archive directory and running the script, the errors appear on the terminal but they don't get written to the log file. I only ever get the echoed strings in the log file.
I thought the 2>> would reroute all errors to the log file?