OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 18.1 Legacy Series »
  • CLI Backup
« previous next »
  • Print
Pages: [1]

Author Topic: CLI Backup  (Read 3407 times)

guest15389

  • Guest
CLI Backup
« on: January 29, 2018, 04:44:41 pm »
I was using this:

https://forum.opnsense.org/index.php?topic=4690.msg18194#msg18194

I'm not sure if something changed with my Linux box as I made a move from Debian to Fedora, but I just noticed I'm getting an error when using your script:

Code: [Select]
/home/felix/scripts/router/opn_backup.rb:42:in `<main>': undefined method `scan' for nil:NilClass (NoMethodError)
Does it need an update or am I just missing something that needs to be installed?

Code: [Select]
ruby -v
ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2770
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: CLI Backup
« Reply #1 on: January 29, 2018, 05:35:43 pm »
This is not an issue with your box - it seems like the XSRF protection has changed and the script was not aware of it - I updated the script so it should work again but it will need an XML parser (nokogiri) to work.

You can install this dependency using
Code: [Select]
gem install nokogiri. It might be in your package manager as well because it is a very common package.
Logged

guest15389

  • Guest
Re: CLI Backup
« Reply #2 on: January 29, 2018, 05:50:49 pm »
I was able to get that installed but still generates the same error.
Code: [Select]
[felix@plex router]$ gem install nokogiri
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.8.2
Parsing documentation for nokogiri-1.8.2
Installing ri documentation for nokogiri-1.8.2
Done installing documentation for nokogiri after 7 seconds
1 gem installed
[felix@plex router]$ ls
ppn_backup  opn_backup.rb
[felix@plex router]$ ./opn_backup
/home/felix/scripts/router/opn_backup.rb:42:in `<main>': undefined method `scan' for nil:NilClass (NoMethodError)
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2770
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: CLI Backup
« Reply #3 on: January 29, 2018, 06:02:34 pm »
did you download the new version of the script?
Logged

guest15389

  • Guest
Re: CLI Backup
« Reply #4 on: January 29, 2018, 06:05:33 pm »
I did, but didn't update my main script to use the new one. Fixed and working now.

Thanks!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 18.1 Legacy Series »
  • CLI Backup
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2