I have a Ubuntu 18.04 server that uses a combination of rsync and duplicity for backup purpose. Both are configured to sync the files to a SMB server with shell scripts run in a cronjob for the root user. The SMB server is mounted using data from /etc/fstab as /mnt/backup.
My SMB share, hosted on a qnap TS-431Xeu NAS, do sometimes go offline for updates or configuration updates. That causes rsync and duplicty to sync their files to the local disk under /mnt/backup resulting in serious problems with the server disk space.
So my question is: Is there a way to prevent all programs (or just rsync and duplicity) to write their files if the SMB share is not mounted at /mnt?
My fstab SMB entries:
Code:
# Connect SMB share for backup purpose
//<ip address>/Sikkerhetskopi\040(Linux)/ /mnt/backup cifs credentials=<removed for security>,iocharset=utf8 0 0
//<ip address>/Multimedia/Mediaserver/ /mnt/mediaserver cifs credentials=<removed for security>,iocharset=utf8 0 0
Thanks in advance