Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rear exits successufly when unknown backup method is specified #914

Closed
zelial opened this issue Jul 14, 2016 · 4 comments
Closed

rear exits successufly when unknown backup method is specified #914

zelial opened this issue Jul 14, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@zelial
Copy link

zelial commented Jul 14, 2016

Relax-and-Recover (rear) Issue Template

Please fill in the following items before submitting a new issue:

  • rear version (/usr/sbin/rear -V):
    1.17.2 / Git

  • OS version (cat /etc/rear/os.conf or lsb_release -a):
    RedHatEnterpriseServer 7

  • rear configuration files (cat /etc/rear/site.conf or cat /etc/rear/local.conf):
    OUTPUT=USB

    OUTPUT_URL="rsync://192.168.122.153/home/rear"

    USB_DEVICE=/dev/sda1
    GRUB_RESCUE=1
    GRUB_PASSWORD=rootroot
    BACKUP_URL=usr:///dev/sda1
    BACKUP=HAHAHAHA

  • Brief description of the issue
    rear mkbackuponly appears to work even though it doesn't create the backup (doesn't print any error and exits with exit code 0). In verbose mode It does prints a warning message, but it suggest it might still work:

The BACKUP method "HAHAHAHA" is not known to rear. Use on your own risk

  • Work-around, if any
@jsmeix jsmeix added enhancement Adaptions and new features cleanup labels Jul 14, 2016
@jsmeix jsmeix added this to the Rear v1.19 milestone Jul 14, 2016
@jsmeix jsmeix self-assigned this Jul 14, 2016
@jsmeix
Copy link
Member

jsmeix commented Jul 14, 2016

Technically it would be easy to let
usr/share/rear/backup/default/00_valid_backup_methods.sh
error out if a BACKUP method is not known to rear
by replacing

    LogPrint "The BACKUP method ...

with

    Error "The BACKUP method ...

@schlomo @gdha
I wonder if it is a good idea to error out
when a BACKUP method is not found
in usr/share/rear/conf/default.conf

In general I think rear should error out if mandatory
conditions to propceed are not fulfilled cf.
https://github.com/rear/rear/wiki/Coding-Style

In this particular case I think it is a good idea
to error out when a BACKUP method is not found
in usr/share/rear/conf/default.conf regardless
that this is strictly speaking not a mandatory
condition to propceed because the BACKUP method
could be implemented nevertheless.

On the other hand I think all implemented BACKUP methods
should be mentioned in usr/share/rear/conf/default.conf

If someone implements a new BACKUP method
he would immediately notice via that error out
that he must also mention it in default.conf
which ensures a minimum documentation about
what BACKUP methods are implemented in rear.

I did a pull request: #916

@zelial

Background information:

In general you have zillions of possibilities
to make improper settings in /etc/rear/local.conf.

In practice it is impossible to check all conditions
to ensure that "rear mkbackup" only succeeds
when actually everything is right.

In general you must carefully verify that your
particular disaster recovery procedure that you set up
in your environment actually works for your systems.

@jsmeix
Copy link
Member

jsmeix commented Jul 14, 2016

See the initial issue #159

FYI:
"git blame usr/share/rear/backup/default/00_valid_backup_methods.sh"
shows 00_valid_backup_methods.sh was created by
commit fc9722d
and "git log" shows that it was because of #159

@gdha
Copy link
Member

gdha commented Jul 14, 2016

@jsmeix OK lets bail out when BACKUP method is not known - however, this means we should start with a developers guide, no?

@jsmeix
Copy link
Member

jsmeix commented Jul 15, 2016

Yes!
I fully agree to have a Relax-and-Recover developers guide.

I initiated
https://github.com/rear/rear/wiki/Developers-Guide

If you have time, just add what you like to have there
but of course: first things first i.e. enjoy your leisure time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants