Periodical backup

Did a manual copy work?

chmod: veranderen van toegangsrechten van '/backup': Actie is niet toegestaan

Try sudo chmod before mounting.
Are you able to copy a file to /backup executed by a script? In this case we might need to look at the backup script.

Did that. But mounting reset the permissions…

erik@MinipcLG2:/$ ls -l
totaal 2097236
drwxrws---   2 root users       4096 mrt  9 15:14 backup
lrwxrwxrwx   1 root root           7 nov 17 10:06 bin -> usr/bin
drwxr-xr-x   4 root root        4096 mrt  8 18:26 boot
drwxr-xr-x   2 root root        4096 nov 17 10:11 cdrom
drwxr-xr-x  19 root root        4260 mrt  7 23:12 dev
drwxr-xr-x 159 root root       12288 mrt  7 22:48 etc
drwxr-xr-x   4 root root        4096 nov 17 10:11 home
lrwxrwxrwx   1 root root           7 nov 17 10:06 lib -> usr/lib
lrwxrwxrwx   1 root root           9 nov 17 10:06 lib32 -> usr/lib32
lrwxrwxrwx   1 root root           9 nov 17 10:06 lib64 -> usr/lib64
lrwxrwxrwx   1 root root          10 nov 17 10:06 libx32 -> usr/libx32
drwx------   2 root root       16384 nov 17 10:05 lost+found
drwxr-xr-x   2 root root        4096 jul 11  2023 media
drwxr-xr-x   2 root root        4096 jul 11  2023 mnt
drwxr-xr-x   2 root root        4096 jul 11  2023 opt
dr-xr-xr-x 289 root root           0 mrt  7 22:51 proc
drwx------   9 root root        4096 mrt  7 18:14 root
drwxr-xr-x  42 root root        1220 mrt  9 14:16 run
lrwxrwxrwx   1 root root           8 nov 17 10:06 sbin -> usr/sbin
drwxr-xr-x   2 root root        4096 jul 11  2023 srv
-rw-------   1 root root  2147483648 nov 17 10:05 swapfile
dr-xr-xr-x  13 root root           0 mrt  7 22:51 sys
drwxr-xr-x   9 root root        4096 mrt  9 15:00 timeshift
drwxrwxrwt  23 root root        4096 mrt  9 15:13 tmp
drwxr-xr-x  14 root root        4096 jul 11  2023 usr
drwxr-xr-x  11 root root        4096 jul 11  2023 var

I am not:

erik@MinipcLG2:~/Documenten$ ls
testbestand  testscript.sh
erik@MinipcLG2:~/Documenten$ sudo bash testscript.sh
mv: kan status van '/backup/testbestand' niet opvragen: Toegang geweigerd

testscript.sh:

#!/bin/bash
mv /home/erik/Documenten/testbestand /backup

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 ? ) ?

mv command requires sudo. Could you test it again with sudo?
Again, I also had this problem a while ago. Why not mounting permanently this folder?

No difference…

Tried that, but so far that’s not the solution:

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 :slight_smile: I just want the backup files in the mounted directory :slight_smile:

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?

1 Like

Great idea! I did this, and it works.

I wish I could tag multiple posts as “solution”, and thus thank more than one person! :slight_smile:

1 Like