for computer in $unixcomputers
do
(
+ # Check that the target filesystem is mounted
+ # (actually check that it's not the root filesystem)
+ rootfilesystem=`df -P /`
+ targetfilesystem=`df -P "$storagedir/$computer"`
+ if [ "$rootfilesystem" == "$targetfilesystem" ]; then
+ echo `date`" $computer: Target filesystem ($storagedir/$computer) was mounted on /. Aborting"
+ continue
+ fi
+
echo `date`" $computer: Backing up $computer" >&2
# Try to SSH to the computer without entering a password.