erik@MinipcLG2:~/Documenten$ ls
testbestand testscript.sh
erik@MinipcLG2:~/Documenten$ sudo bash testscript.sh
mv: kan status van '/backup/testbestand' niet opvragen: Toegang geweigerd
As far as I understand you try to write as user root ( sudo ).
How is the export defined for this mount ? Does it allow user root to write as user root from the client ?
Option no_root_squash in exports should allow this.
Do you want to write as user root or shall members of group users write to that directory ( do they have enough permission to read all files on the client ? ) ?
erik@MinipcLG2:~$ sudo mount -t nfs 192.168.1.10:/openHAB-backup /home/erik/Openhab-backups/
erik@MinipcLG2:~$ sudo /usr/bin/openhab-cli backup /home/erik/Openhab-backups/openhab-$(date +%A).zip
Using '/etc/openhab' as conf folder...
Using '/var/lib/openhab' as userdata folder...
Using '/usr/share/openhab/runtime' as runtime folder...
Unable to locate specified directory '/home/erik/Openhab-backups'
I don’t really care I just want the backup files in the mounted directory
Make sure you restart the processes and mounts, NFS is finnicky with that sometimes.
I prefer using rsync to sync files over to my nas(would actually like it even better if NAS initiated this, so pull instead of push), this prevent unnecessary mounts over NFS which might fail silently.
If only goal is to get backups of the machine onto the nas that might be an option?