#! /bin/bash

bak=/mnt/backup
 
sudo umount $bak
sudo mount $bak
 
if [ $? -eq 0 ]; then
  rsync -avvi --progress /opt/data/family/ $bak/family/
  rsync -avvi --progress $bak/family/ /opt/data/family/
fi
 
sudo umount $bak

#! /bin/bash

bak=/mnt/backup

sudo /bin/umount $bak
sudo /bin/mount $bak
 
if [ $? -eq 0 ]; then
  rsync -au --progress --size-only /opt/data/family/ $bak/family/
  rsync -au --progress --size-only --chmod=o-w $bak/family/ /opt/data/family/
fi
 
sudo /bin/umount $bak

Make sync script more suitable for execution by cron
Make sync script more suitable for execution by cron
