#68 Issue closed: Option to specify the rear config file to use

Labels: enhancement, discuss / RFC

pavoldomin opened issue at 2012-04-12 17:13:

Assume, we want to automate rear backup with the different setup on different days. E.g. ISO & tar.gz to URL on Mondays and OBDR on Fridays. The possible method would be to have option, that tells rear, which config files to use, like,

rear -d /etc/rear.monday/ -v mkrescue

would source local.conf (and other .conf) in /etc/rear.monday/.

dagwieers commented at 2012-04-12 19:39:

I would prefer a specific option like:

rear -v -c /etc/rear/monday.conf mkrescue

Which is more in line with how other Unix tools work. But the functionality looks interesting.

pavoldomin commented at 2012-04-13 07:25:

How would we here handle another conf files rear sources - site.conf, local.conf, rescue.conf, disklayout.conf.
Also, when we do a recovery, it should proceed transparently, without need to specify proper conf file, accordingly to initrd we booted from, i.e. configuration dir would be copied as /etc/rear to initrd image

dagwieers commented at 2012-04-13 19:45:

There are various ways to do this. Currently we only discussed functionality. It is quite likely we have to modify the current implementation and how config files are handled in order to support this functionality, so I don't want to go into the details of a (possible) implementation and first discuss how it should work.

And you are right, the specified configuration should be used inside the rescue image that is created. That is a functional requirement.

gdha commented at 2012-06-01 18:03:

interesting idea, but not very practical in recovery mode I think. How would we know which local*.conf was used? To be honest I'm not in favour of this proposal.

pavoldomin commented at 2012-06-01 18:41:

The background for the proposal is to have recovery media 'highly available'. In fact, we have several customers requesting such functionality (and people work it around by hacking rear script or writing wrappers). I do not see problem with selection of correct local_.conf file in recovery mode really: recovery image will only handle /etc/rear/_ with the actual conf files included at time of mkrescue, assuming my '-d /path/to/rear_conf_dir' proposal:

Another possibility: rear would check, whether environment variable like "REAR_CONF_DIR" is exported, and read the config from path it specifies. Cron would than schedule jobs like "REAR_CONF_DIR=/etc/rear.monday rear mbackup".

dagwieers commented at 2012-06-03 00:08:

Please let us not discuss the technical implementation now, but first look at the requirements and use-cases. I don't want a discussion of a technical implementation if we haven't fully looked into the merits of such functionality. Since there are higher priority items on the plate, I prefer if we pick this up later. And who knows, by that time other functionality can be taken into account too.

(For example, we plan to make Rear usable without the need to install it. Which could be a solution to your needs as well. But even if that's not preferable for whatever reason, the reorganization might bring other insights. So don't look at the technical implementation just yet for now...)

pavoldomin commented at 2012-06-06 07:51:

Sure, absolutely. Just consider my speculations here as low priority feature request.

jhoekx commented at 2013-04-03 12:00:

This is implemented in 28bac7ad4e6ab67e4e955fec27fc3556082c896e and working for me. More testing is welcome.

spland30 commented at 2021-11-14 14:22:

Just an observation.

First, I believe the user was very clear on the requirement. They outlined the need and then gave examples to further help explain the requirement.

Second, If I were to design this... By default, Rear would always use the config file imbedded in the rescue image. However, Rear should also provide an option to override the default configuration by specifying the config file at the command line. It shouldn't have been that difficult to implement this change.

The other question is... where in the documentation does it say that the config file is part of the recue image. I find that the rear documentation is lacking in many areas, I spent weeks trying to get this tool up and running because there was not adequate documentation. Users should not have to read 1000's lines of code to fully understand how the tools works. People don't have time to read code, or run any needless trial buy error tests to understand it's functionality or why the tool is not working as expected.

gdha commented at 2021-11-15 08:57:

@spland30 Have a look at https://relax-and-recover.org/rear-user-guide/
The @rear/contributors also like to have better documentation as you do, but as usual lack of time is the main cause of running late (really late). The ReaR User Guide sub-project is a attempt to improve this situation. However, my time is limited and every hour I spend on it is unpaid and I am not an employee so I hope you understand my problem...
There are solutions, but I leave it as an exercise for you to find out.


[Export of Github issue for rear/rear.]