From 6e113f42d3e6cc9666d904f97e392faa0ac6bce6 Mon Sep 17 00:00:00 2001 From: Andreas Pfeiffer Date: Wed, 23 Sep 2020 23:58:49 +0200 Subject: [PATCH] check if nfs mount was successful --- backupfiles_to_nfs.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backupfiles_to_nfs.sh b/backupfiles_to_nfs.sh index 6b36070..5b39af9 100644 --- a/backupfiles_to_nfs.sh +++ b/backupfiles_to_nfs.sh @@ -21,6 +21,7 @@ nfsmountdir=/path/to/backup/ # Ordner fuer NFS-Share ################# CONFIG END ################# + #Clear mailtext echo " " > $mailtext; @@ -50,7 +51,16 @@ else fi #mount NFS to backupdir +echo -n "mount nfs share $nfsmount ... " >> $mailtext; mount $nfsmount $nfsmountdir +if [ $? == "0" ] +then + echo -n " done" >> $mailtext + echo "\n" >> $mailtext +else + echo -n " error" >> $mailtext + echo "\n" >> $mailtext +fi # Check Backupdir if test -d $backupdir