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

Examples from the config file cannot be parsed #1

Open
rkandilarov opened this issue Apr 16, 2019 · 2 comments
Open

Examples from the config file cannot be parsed #1

rkandilarov opened this issue Apr 16, 2019 · 2 comments
Labels
bug scope/docs related to the documentation

Comments

@rkandilarov
Copy link

Hi!

I've tested rsnapshot-ng on Ubuntu 16.04

wget -O - https://packages.aenon-dynamics.com/static/pubkey.pgp | apt-key add - 
echo "deb https://packages.aenon-dynamics.com/debian stable main" > /etc/apt/sources.list.d/aenon-dynamics.list
apt update
apt install -y rsnapshot-ng

Then uncomment in /etc/rsnapshot.conf the following line:

# EXAMPLE.COM
backup_exec /bin/date "+ backup of example.com started at %c"

and running rsnapshot configtest I receive:

ERROR: /etc/rsnapshot.conf on line 225:
ERROR: backup_exec /bin/date "+ backup of example.com started at %c" - \
         requirement level "+ backup of example.com started at %c" is \
         invalid 
ERROR: ---------------------------------------------------------------------
ERROR: Errors were found in /etc/rsnapshot.conf,
ERROR: rsnapshot can not continue. If you think an entry looks right, make
ERROR: sure you don't have spaces where only tabs should be.

It seems that rsnapshot-ng expect the command to be only the first parameter after backup_exec so wrapping all argument inside quotation marks like:

backup_exec "/bin/date '+ backup of example.com started at %c'"

seems to do the trick. The second argument to the backup_exec command seems to be either empty (or string optional) or the string required as per line 1144. But, I'm not a python guy and cannot understand howto escape the quotations in case I need them inside the command itself - backslash " does not work.

Is this expected behaviour?

Perhaps all examples need to be changed if I got right the idea behind backup_exec.

Kind regards!

@AndiDittrich
Copy link
Member

Hi @rkandilarov

the first argument includes the command (with all arguments). the second one defines the importance (how errors of the command should be handled by rsnapshot.

i have to update the docs, because of the new config parser the "old" command strings with spaces won't work anymore - therefore it has the be wrapped in quotes

best regards, Andi


from the original docs:

backup_exec simply runs the command listed. The second argument is not required and defaults to a value of 'optional'. It specifies the importance that the command return 0. Valid values are 'optional' and 'required'. If the command is specified as optional, a non-zero exit status from the command will result in a warning message being output. If the command is specified as 'required', a non-zero exit status from the command will result in an error message being output and rsnapshot itself will exit with a non-zero exit status.

@AndiDittrich AndiDittrich added bug scope/docs related to the documentation labels Apr 16, 2019
@rkandilarov
Copy link
Author

@AndiDittrich ,

Thank you for the clarification!

Regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug scope/docs related to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants