0

I'm currently attempting to configure the ClamAV module via drush config-set. When using the executable mode, the module allows us to specify command-line options to run when the ClamAV executable is triggered.

My attempt to do so is: [root@localhost html]# drush config-set clamav.settings mode_executable.executable_parameters '--max-filesize=4095M --max-scansize=4095M --max-embeddedpe=4095M --max-htmlnormalize=4095M --max-htmlnotags=4095M --max-scriptnormalize=4095M --max-ziptypercg=4095M --pcre-max-filesize =4095M' --y

Unfortunately, I get the error: Unknown option: --max-filesize. Seedrush help config-setfor available options. To suppress this error, add the option --strict=0.

Using sh/bash, how do I write this command as to pass in the executable parameters as the setting (a literal string), not as options to drush config-set, as is currently happening?

2

Short answer, preface the value with an empty space (inside the quotes).

This appears to be a drush bug. This fails with the unknown option bit:

drush config-set system.site name '--max-filesize=blah'

However, if I preface the value with a space:

drush config-set system.site name ' --max-filesize=blah'

this works as expected.

Edit: It is also worth noting that drush config-edit would bypass this issue altogether, and allow the value to be set via your preferred text editor.

| improve this answer | |
  • This was very helpful, and this ultimately solved our problem. Due to my low rep, I can't upvote, but would if I could. – shawmanz32na Feb 14 '17 at 23:51
1

It's possible to use the --value option instead of inferring the value by location. See https://drushcommands.com/drush-8x/config/config-set/ for the config-set docs.

This won't work, due to a drush bug - see https://drupal.stackexchange.com/a/225739/64107)

drush config-set clamav.settings mode_executable.executable_parameters '--max-filesize=4095M'

but this will:

drush config-set clamav.settings mode_executable.executable_parameters --value='--max-filesize=4095M'

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.