Now, everytime that I have a power blackout or I reboot the nas, I have to remember to remount it manually, otherwise I get no backup.
At least the last changes work well because previously,the files was saved to the data partition if the remote share was no longer available...:whistle
Otherwise, we could add an option to auto-mount these remote shares
Note play with fstab is not a good way because it's overwritten at each booting.
if you have linux acknowledge you can create a shell script which checks if the remote share are still mounting and if not it remounts it.
Then before your backup cron job add a new job to perform your shell.
Note:
to detect if a remote samba share is mounted:
- Code: Select all
mount |grep -c '//remoteIP/remotesharename on /share/1000'
return 1 if is there. (of course replace remoteIP and remotesharename by the relevant value)
and for mounting a remote samba share
- clean a maybe orphan mount :
- Code: Select all
umount /mnt/remote_share_mount_dir/remoteIP-smb-remotesharename
- and mount the share:
- Code: Select all
mkdir -p -m 777 /mnt/remote_share_mount_dir/remoteIP-smb-emotesharename
mount -t cifs //remoteIP/remotesharename /mnt/remote_share_mount_dir/remoteIP-smb-emotesharename -o rw,iocharset=utf8,username=yourlogin,password=yourpasswd
mount -o bind /mnt/remote_share_mount_dir/remoteIP-smb-remotesharename /share/1000/remoteIP-smb-remotesharename
---edit---
attached a shell script type. you must replace each remoteIP, remotesharename, your login and your password by their relevant value.
You do not have the required permissions to view the files attached to this post.