home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux.suse      Suse is actually not that bad      138,051 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 137,634 of 138,051   
   Aragorn to All   
   Re: yardstick up my behind   
   21 Nov 22 03:05:54   
   
   From: telcontar@duck.com   
      
   On 20.11.2022 at 21:58, Carlos E.R. scribbled:   
      
   > On 2022-11-20 15:02, bad sector wrote:   
   >   
   > > they are mountpoints for data drive partitions   
   >   
   > And they were not mounted. Typical issue, happens millions of times.   
   >   
   > You should, in your backup script, verify the mount succeeded.   
   >   
   > mount /abc   
   > MOUNT=`mount | grep /abc`   
   > if ! test -n "$MOUNT" ; then   
   >      echo "*** ERROR: could not mount, aborting"   
   >      echo   
   >      echo $MOUNT   
   >      exit   
   > fi   
      
   There's a simpler way, which includes neither the invocation of   
   mount(1) nor any output redirection into grep(1).   
      
   When you are certain that the volume in question is not mounted, simply   
   create a single empty file with an indicative name in the directory   
   intended as the mountpoint, e.g.   
      
      
      # touch "${directory}/NOT_MOUNTED"   
      
      
   Then, all you have to do later in order to check whether the volume is   
   mounted or not is test for the existence of said file.   
      
      
      if [ -f "${directory}/NOT_MOUNTED" ]   
      then   
         echo "Volume not mounted.  Aborting..."   
      else   
         rsync ${options} "${source}/" "${directory}/"   
      fi   
      
   --   
   With respect,   
   = Aragorn =   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca