Subj : Re: Backup script tuning To : paulie420 From : paulie420 Date : Thu Sep 15 2022 17:56:33 pa> my first attempt at checking exit codes. Do things l00k right? Well, I've tested and I'm getting err0rs. :/ ../backup.sh: line 6: [: retVal: integer expression expected ../backup.sh: line 12: [: retVal: integer expression expected ../backup.sh: line 18: [: retVal: integer expression expected Lines 6, 12 & 18 are; if [ retVal -ne 0 ]; then Spot my issue? I ran some test scripts using the above, I thought, and both exits were detected. (complete script again;) paulie420@pbs:~$ cat backup.sh #!/bin/bash #Backup 3 external HDDs to 16TB Drive retVal=$? rsync -av --delete /mnt/Beers4TB/ /mnt/datastore/PBS_backup/Beers4TB if [ retVal -ne 0 ]; then echo "There was an rsync error backing up Beers4TB:" >> ~/backup_info.txt && echo $retVal >> ~/backup_info.txt else echo $(date) >> ~/backup_info.txt && echo "/mnt/Beers4TB -> /mnt/datastore/PBS_Backup/Beers4TB COMPLETE!" >> ~/backup_info.txt fi rsync -av --delete /mnt/Backup4TB/ /mnt/datastore/PBS_backup/Backup4TB if [ retVal -ne 0 ]; then echo "There was an rsync error backing up Backup4TB:" >> ~/backup_info.txt && echo $retVal >> ~/backup_info.txt else echo $(date) >> ~/backup_info.txt && echo "/mnt/Backup4TB -> /mnt/datastore/PBS_Backup/Backup4TB COMPLETE!" >> ~/backup_info.txt fi rsync -av --delete /mnt/Backup6TB/ /mnt/datastore/PBS_backup/Backup6TB if [ retVal -ne 0 ]; then echo "There was an rsync error backing up Backup6TB:" >> ~/backup_info.txt && echo $retVal >> ~/backup_info.txt else echo $(date) >> ~/backup_info.txt && echo "/mnt/Backup6TB -> /mnt/datastore/PBS_Backup/Backup6TB COMPLETE!" >> ~/backup_info.txt fi echo "-----" >> ~/backup_info.txt exit $retVal |07p|15AULIE|1142|07o |08......... --- Mystic BBS v1.12 A48 2022/07/15 (Linux/64) * Origin: 2o fOr beeRS bbs>>>20ForBeers.com:1337 (1337:3/129) .