AutoConfigBackup enable/disable



  • I have remote sites with slow links. When I am making quite a few changes (e.g. allocating static-mapped IPs to a bunch of devices with DHCP leases from the pool) then AutoConfigBackup is uploading a backup every time, and that is slow. It would be nice if this package had an enable/disable checkbox. Then I could disable it (leaving the package settings there), make a bunch of changes, then enable AutoConfigBackup again and (usually) make a specific manual backup.
    When changed from enable->disable, don't do a backup of that change.
    When changed from disable->enable, do an "initial" backup at that time.

    Then for safety there should be an alert on the webGUI whenever AutoConfigBackup is installed but disabled, so that admins can't easily forget to enable it again - otherwise people might be disappointed when they accidentally run for months with it disabled!



  • Sorry to dig up an old thread, but after a Google search, this thread seemed the most relevant to what I was looking to do, and may be a good start to helping anyone else looking to do the same.

    Currently it just adds a 'Disable ACB' checkbox to the Settings tab of 'Diagnostics: Auto Configuration Backup', and skips uploading the config if that's set (not too sure if that's the best way, but it works for now).

    Tested with AutoConfigBackup 1.28.

    It needs two patches. (can you change multiple files in the same patch?)

    Fields not listed can be left at the default of a new patch.

      • add new patch.
    • Description: autoconfigbackup.xml - disable ACB

    • Patch contents:

    *** /usr/local/pkg/autoconfigbackup.xml.orig
    --- /usr/local/pkg/autoconfigbackup.xml
    ***************
    *** 132,137 ****
    --- 132,143 ----
                            <fieldname>crypto_password2</fieldname>
                            <type>password</type>
    
    +               <field>+                       <fielddescr>Disable ACB</fielddescr>
    +                       <description>+                       <fieldname>disable_autoconfigbackup</fieldname>
    +                       <type>checkbox</type>
    +</description></field> 
    
            <custom_php_validation_command>
                    custom_php_validation_command($_POST, $input_errors);</custom_php_validation_command>
    
      • add new patch.
    • Description: autoconfigbackup.inc - disable ACB

    • Patch contents:

    *** /usr/local/pkg/autoconfigbackup.inc.orig
    --- /usr/local/pkg/autoconfigbackup.inc
    ***************
    *** 139,144 ****
    --- 139,149 ----
            if($g['booting'])
                    return;
    
    +       if ($config['installedpackages']['autoconfigbackup']['config'][0]['disable_autoconfigbackup'] == "on") {
    +               log_error(gettext("AutoConfigBackup: Config not uploaded - ACB is disabled."));
    +               return;
    +       }
    +
            /*
             *   pfSense upload config to pfSense.org script
             *   This file plugs into config.inc (/usr/local/pkg/parse_config)
    

    It needs two patches. (can you change multiple files in the same patch?)

    Seems you can.

      • add new patch.
    • Description: Disable ACB

    • Patch contents:

    diff
    *** /usr/local/pkg/autoconfigbackup.inc.orig
    --- /usr/local/pkg/autoconfigbackup.inc
    ***************
    *** 139,144 ****
    --- 139,149 ----
            if($g['booting'])
                    return;
    
    +       if ($config['installedpackages']['autoconfigbackup']['config'][0]['disable_autoconfigbackup'] == "on") {
    +               log_error(gettext("AutoConfigBackup: Config not uploaded - ACB is disabled."));
    +               return;
    +       }
    +
            /*
             *   pfSense upload config to pfSense.org script
             *   This file plugs into config.inc (/usr/local/pkg/parse_config)
    diff
    *** /usr/local/pkg/autoconfigbackup.xml.orig
    --- /usr/local/pkg/autoconfigbackup.xml
    ***************
    *** 132,137 ****
    --- 132,143 ----
                            <fieldname>crypto_password2</fieldname>
                            <type>password</type>
    
    +               <field>+                       <fielddescr>Disable ACB</fielddescr>
    +                       <description>+                       <fieldname>disable_autoconfigbackup</fieldname>
    +                       <type>checkbox</type>
    +</description></field> 
    
            <custom_php_validation_command>
                    custom_php_validation_command($_POST, $input_errors);</custom_php_validation_command>
    

Log in to reply