Answer the question
In order to leave comments, you need to log in
How to check the creation status of a tar archive?
Part of my backup script creates a tarball of the content I want to backup. The question actually is, how can you embed a check on the status of creating an archive? What came to my mind is checking the exit code:
/bin/tar -czvf $BACKUP $CONTENT >> $LOG
if [ $? != 0 ]; then
cat $LOG | mail -s "$SITE backup failure!" $EMAIL
fi
Answer the question
In order to leave comments, you need to log in
/bin/tar -czvf $BACKUP $CONTENT >> $LOG
I very often get emails with a log of creating an archive that does not contain errors
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question