Amanda howto for openhabian and NAS

I don’t know. Why don’t you just backup /etc/default or /etc ?

hey @mstormi I have following issue:

[13:12:11] backup@openhab:~$ amcheck openhab-dir
ERROR: could not open temporary amcheck output file /tmp/amanda/amcheck.temp.2745: Permission denied
Check permissions
[13:49:34] backup@openhab:~$ ls /tmp/amanda/
ls: cannot open directory ‘/tmp/amanda/’: Permission denied
[13:49:46] backup@openhab:~$ ls -ld /storage/server
drwxrwxrwx 6 backup backup 4096 Sep 10 13:01 /storage/server

I did at least one thing wrong. I started the setup of amanda and then cancelled it because I did not read the instructions properly. I read them, mounted NAS to /storage/server tested if backup user could make a file and remove a file and redid the installation. But now I m stuck in a presumably Unix user permission problem. Any hint for me here ?

backup is not part of the sudo group.

as root, you can remove /tmp/amanda*

You can also remove /storage/server (or whatever your storage is) and redo the install.

Ok this is embarrassing, did a reboot and tried again:

[14:12:16] backup@openhab:~$ amcheck --version
amcheck-3.5.1
[14:12:23] backup@openhab:~$ amcheck openhab-dir
Amanda Tape Server Host Check

slot 1: contains an empty volume
Will write label ‘openHABian-openhab-dir-001’ to new volume in slot 1.
NOTE: skipping tape-writable test
NOTE: storage ‘openhab-dir’: retentions-tapes (14) <= runspercycle (14)
NOTE: host info dir ‘/var/lib/amanda/openhab-dir/curinfo/openhab’ does not exist
It will be created on the next run
NOTE: index dir ‘/var/lib/amanda/openhab-dir/index/openhab’ does not exist
it will be created on the next run
Server check took 5.597 seconds
Amanda Backup Client Hosts Check

Client check: 1 host checked in 6.554 seconds. 0 problems found.
(brought to you by Amanda 3.5.1)
[14:12:40] backup@openhab:~$

Beginners mistake I guess. Read the readme thoroughly though but could not find the fact that after installing reboot is necessary.
thanks for your reply.

Because it isn’t necessary if you follow the install instructions properly.
Any reboot will remove everything from /tmp, that’s why.

1 Like

Hi,
until now I was just syncing my setup to my NAS via rsync (poor man backup). But looking through the openhab3 documentation I found Amanda and it looks very promising.

I am very interested in the raw image backup but I have problems understanding how it will create a consistent backup. Leaving problems like databases aside wouldn’t also simple changes on the running ext4 file system during the backup make the result corrupt? Since dd doesn’t know anything about the filesystem.
Would the usage of a file system the supports snapshots or LVM help in that case? Is snapshotting during the full raw backup part of the solution?

Marek

PS: Thank you for the support of all the people in this forum. You people are great!

1 Like

No Raspi OS doesn’t support snapshotting.
Amanda has been in use in many data centers for 20 years and more

And OH hardly writes to disk anyway, all of that is essentialy expendable data plus we have multiple copies.
It’s far less of a problem than you think. Rather an academic than a real one.

1 Like

Hello.

It is possible to skip chown --recursive backup:backup /storage/server step during Amanda installation somehow?

The script tries to do this even if backup user already owns the directory.

My problem is that my NAS by default set all_squash option for share, which allow backup user to create subfolders but doesn’t allow to chown (even for root).
If I set no_root_squash option I can call chown but backup user can’t create subfolders (even when it is an owner of the folder).

So is the a way to bypass the chown command for the script if backup user already owns the destination folder?

Why we even need to change owner of the folder if we check that backup user can create subfolders in destination folder.

chown is required for Amanda to work.
And I don’t see your 2nd point, running as root it will work if your NAS is correctly setup.

Feel free to enter stuff manually or edit the code in /opt/openhabian/functions/backup.bash.