I would like to be able to mount a remote folder (CIFS / SMB), perform an rsync, and dismount the folder. If not all that, at least check if the folder is mounted and mount it if not already mounted. (I've already got the rsync script running.) I have no trouble mounting the folder using the DSM GUI, but I cannot get it to work in a script.
So far I've been testing it from an SSH terminal rather than a script. (I discovered I have to have root authority, not just admin authority, to supply mount options. I got around that problem with "sudo -i", but it think it will not be a problem in a script because I can run the script under root.) But I I thought it should be fairly straightforward, but I can't get it to work.
BTW, in the following command the username and password are dummies. This is a public share so no credentials are required except to satisfy the syntax. But DSM apparently saved credentials and validates against them (even though the remote NAS doesn't care). I'm now stuck with x and y.
I enter
I've tried with and without the trailing slash on both the remote folder and the mount point. All attempts give the same result. But when I mount through the DSM GUI and display the results I see
It looks to me like I've entered the correct names. Anyone see what I'm doing wrong?
So far I've been testing it from an SSH terminal rather than a script. (I discovered I have to have root authority, not just admin authority, to supply mount options. I got around that problem with "sudo -i", but it think it will not be a problem in a script because I can run the script under root.) But I I thought it should be fairly straightforward, but I can't get it to work.
BTW, in the following command the username and password are dummies. This is a public share so no credentials are required except to satisfy the syntax. But DSM apparently saved credentials and validates against them (even though the remote NAS doesn't care). I'm now stuck with x and y.
I enter
but I get the error messageroot@DS218_2:~# 'mount -t cifs -o username=x,password=y,ro,vers=3.0,nodfs \\OF-Pub-NAS1\Public\ /volume1/Mount_Points/OF-Pub-NAS1/Public/'
-ash: mount -t cifs -o username=x,password=y,ro,vers=3.0,nodfs \\OF-Pub-NAS1\Public\ /volume1/Mount_Points/OF-Pub-NAS1/Public/: No such file or directory
I've tried with and without the trailing slash on both the remote folder and the mount point. All attempts give the same result. But when I mount through the DSM GUI and display the results I see
It looks to me like I've entered the correct names. Anyone see what I'm doing wrong?