The
standard output stream of tar is the tarfile itself (which is put by the script into the backup file). I'm guessing that what you want to see is the
standard error stream, where diagnostics are more often sent.
Since your
crontab script only pipes the stdout to the email, you are losing the stderr output. In
bash you can use something like this to pass both stderr and stdout through the pipe to the email:
Code:
00 22 * * 1-5 bash /home/user/RoutineBackupTest.sh 2>&1 | mail -s "Backup Log" firstname.surname@company.com
(where the '2>&1' says to redirect stderr output to stdout)
Alternatively you can just use:
Code:
00 22 * * 1-5 bash /home/user/RoutineBackupTest.sh |& mail -s "Backup Log" firstname.surname@company.com
(which might be more portable, in cases where you aren't using bash)