#3268 Issue open: configuration question

Labels: support / question

oelkie opened issue at 2024-07-07 10:09:

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
  • OS is debian11

  • is there certain sequence for the variables in /etc/rear/local.conf?

  • the output of 'rear -v mkbackup' showed
    excluding component fs:/var
    what if have, for example, a mysql database under /var?

  • if i use this config:
    OUTPUT=ISO
    OUTPUT_PREFIX="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')"
    OUTPUT_URL=file:////var/lib/rear/output
    BACKUP=NETFS
    BACKUP_URL=file:///var/lib/rear
    ISO_PREFIX="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')"
    i got two ISOs:
    /var/lib/rear/output
    /var/lib/rear/output/debian11.. (with date and time)
    how can i get only one ISO?

  • where are the templates mentioned on the website?

best regards
Achim

gdha commented at 2024-07-08 13:43:

To answer your questions:

  1. The local.conf has to be seen as a Bash script, therefore, the sequence is top-down.
  2. Never include a database in a mkbackup workflow as after a recovery the database could be corrupted.
  3. An ISO is stored under /var/lib/rear/output directory and also a copy is saved on the OUTPUT_URL location. Are you saying you have two ISO's under /var/lib/rear/output then it is because of the way you define the ISO name (with ${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S'). Anyhow, %S will be different.
    Or, define a fixed name in local.conf as ISONAME="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')" and use $ISONAME for OUTPUT_PREFIX=$ISONAME and ISO_PREFIX=$ISONAME
  4. templates can you find under /usr/share/rear/conf/templates/

oelkie commented at 2024-07-08 18:32:

to

  1. i asked if i can set
    OUTPUT=ISO
    OUTPUT_PREFIX="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')"
    OUTPUT_URL=file:////var/lib/rear/output
    BACKUP=NETFS
    BACKUP_URL=file:///var/lib/rear/
    or
    OUTPUT=ISO
    BACKUP=NETFS
    OUTPUT_PREFIX="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')"
    OUTPUT_URL=file:////var/lib/rear/output
    BACKUP_URL=file:///var/lib/rear/
  2. i did that in the past with oracle express edition 11 and it worked fine.
  3. i got on iso in '/var/lib/rear/output' and the other in '/var/lib/rear/output/debian11-2024-07-07-114853'.
    i will try your settings.
  4. templates are not in debian 11, but present in oracle linux 8 and opensuse 15.6. Ok, that's not yout fault.
    I was hoping to find examples in the form of usb.conf, nfs.conf, local_iso.conf and so on.
    It would be nice to find such examples on github.

oelkie commented at 2024-07-08 18:39:

ok, as i set :
OUTPUT=ISO
OUTPUT_PREFIX="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')"
OUTPUT_URL=null
BACKUP=NETFS
BACKUP_URL=file:///var/lib/rear/
i got some errors, but the ISO is build, (only one ISO).
So whats the correct syntax to build a ISO, only one ISO, that is locally stored and have the hostname, date, time in the filename?
This would help as a template....

oelkie commented at 2024-07-08 18:43:

so as i read:
OUTPUT_URL
Backup Target among NFS, CIFS, FILE, FTP, HTTP, RSYNC
BACKUP_URL
Backup target location when using the internal backup method
i don't understand the difference between the both.

gdha commented at 2024-07-09 07:38:

so as i read: OUTPUT_URL Backup Target among NFS, CIFS, FILE, FTP, HTTP, RSYNC BACKUP_URL Backup target location when using the internal backup method i don't understand the difference between the both.

Try to read the man page which should explain it in more depth. If that is not the case tell us.

If you want to see example configuration files see under /usr/share/rear/conf/examples/

oelkie commented at 2024-07-09 09:20:

If you want to see example configuration files see under /usr/share/rear/conf/examples/
Where? On debian 11 there is no directory '/usr/share/rear/conf/examples/'

i tried to read man page and the default.conf that did explain it exactly.
if i set
OUTPUT=ISO
OUTPUT_URL=file://
BACKUP=NETFS
BACKUP_URL=file:///var/lib/rear <- i got an error, this is forbidden.

Or must i set first BACKUP* and then OUTPUT*?

gdha commented at 2024-07-09 10:55:

If you want to see example configuration files see under /usr/share/rear/conf/examples/
Where? On debian 11 there is no directory '/usr/share/rear/conf/examples/'

i tried to read man page and the default.conf that did explain it exactly. if i set OUTPUT=ISO OUTPUT_URL=file:// BACKUP=NETFS BACKUP_URL=file:///var/lib/rear <- i got and error, this i forbidden.

Or must i set first BACKUP* and then OUTPUT*?

BACKUP_URL is the most important one. When OUTPUT_URL is missing then it becomes the same as BACKUP_URL.

oelkie commented at 2024-07-09 19:03:

Hi,
so here at home in my installation i set
OUTPUT=ISO
OUTPUT_URL=file://
BACKUP=NETFS
BACKUP_URL=file:///var/lib/rear
that worked without errors.
A file rear-debian11.iso was created.
I booted from it, tried to restore and that was aborted with 'missing file /var/lib/rear/debian11/backup.tar.gz'
The file was created, but it seems he was not copied to the image.
Why?

gdha commented at 2024-07-11 09:05:

Hi, so here at home in my installation i set OUTPUT=ISO OUTPUT_URL=file:// BACKUP=NETFS BACKUP_URL=file:///var/lib/rear that worked without errors. A file rear-debian11.iso was created. I booted from it, tried to restore and that was aborted with 'missing file /var/lib/rear/debian11/backup.tar.gz' The file was created, but it seems he was not copied to the image. Why?

The BACKUP_URL=file:///var/lib/rear stores the backup archive on the local file system. However, the rescue ISO image is made before the backup is getting made. What you want is the rescue image and archive on the same ISO image, right?
Therefore, have a look at the example configuration file stored at /usr/share/rear/conf/examples/rescue-and-backup-on-same-ISO-image-example.conf

oelkie commented at 2024-07-14 08:57:

OK, a bit about my situation:
I have two routers that I want to back up in an ISO image.
They can't just be rebooted like that.
Both machines have UEFI enabled and SecureBoot disabled.
The goal would be to create a regular ISO backup that I can later write to a USB stick using Rufus and then perform a recovery.
At the moment, I want to limit myself to recreating the situation on another machine (Debian 11.9), creating a local ISO backup and performing a recovery.
Later, create a manual backup of these two routers on a USB stick and, if in doubt, create a recovery.
At the moment, I'm testing the creation of a local ISO image on a VM on proxmox, from which I can then boot and perform a recovery.
Unfortunately, debain 11 only offers rear 2.6 via the repositories,
which apparently doesn't work properly with UEFI yet.
The examples and templates subdirectories you suggested do not exist in rear 2.6 on debian 11.

I could only find them in the snapshot at https://github.com/rear/rear/releases.

I then got https://github.com/rear/rear/releases/download/snapshot/debian-11.zip, which is rear 2.7 and it works quite well:

BACKUP=NETFS
OUTPUT=ISO
BACKUP_URL=iso://
OUTPUT_URL=null
BACKUP_PROG_EXCLUDE=( ${BACKUP_PROG_EXCLUDE[@]} '/tmp' '/var/tmp' )
USING_UEFI_BOOTLOADER=1
ISO_PREFIX="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')"
ISO_FILE_SIZE_LIMIT=4294967296

My setup for a USB stick would be like this look like this:
OUTPUT=USB
USB_DEVICE=/dev/disk/by-label/REAR-000
BACKUP=NETFS
BACKUP_URL=usb:///dev/disk/by-label/REAR-000
BACKUP_PROG_EXCLUDE=( ${BACKUP_PROG_EXCLUDE[@]} '/tmp' '/var/tmp' )
USING_UEFI_BOOTLOADER=1
USB_PREFIX="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')"

Later, the plan would be to run the creation of the ISO image on an NFS share via cron job:
OUTPUT=ISO
OUTPUT_URL=file://
BACKUP=NETFS
BACKUP_URL=nfs://nfs-server-name/share/path/
BACKUP_PROG_EXCLUDE=( ${BACKUP_PROG_EXCLUDE[@]} '/tmp' '/var/tmp' )
USING_UEFI_BOOTLOADER=1
ISO_PREFIX="${HOSTNAME}-$(date '+%Y-%m-%d-%H%M%S')"
ISO_FILE_SIZE_LIMIT=4294967296

To keep multiple backups, I set the ISO_PREFIX with host name, date and time.

Unfortunately, the debian-11.zip seems to be a snapshot, a stable version

Yes, you could argue, 'upgrade to Debian 12,
then rear 2.7 will be offered'.

That will only happen at a much later date.
Or not at all, and a completely different technical solution will take over the functions.

Tomorrow I will try the recovery via USB stick on a test computer with UEFI enabled and SecureBoot.
Best Regards

oelkie commented at 2024-07-14 09:24:

I've just noticed that there's always a file left over in /root (because I ran rear-D mkbackup as root)::
rear-2024-07-14T11:16:42+02:00.log -> /var/log/rear/recover/rear-debian119rear.log
that's a link that doesn't exist.
/var/log/rear/recover/rear-debian119rear.log doesn't exist.
I always have to do a
'touch /var/log/rear/recover/rear-debian119rear.log'
and a
'rm rear-2024-07-14T11:16:42+02:00.log'
after a reboot.
Maybe not so bad, so i can see when a recovery ist done.


[Export of Github issue for rear/rear.]