Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Scheduled backup pf config.xml from a windows server?

    General pfSense Questions
    3
    4
    1.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jabadameh
      last edited by

      I've been hunting down google searches looking for a way that I can periodically (daily) backup the config (with RRD graph data) to my Windows file server for backups etc.

      I've seen many posts about using wget, and I have tried to modify the commands for use on Windows but I just can't make sense of it all. I'm a bit of a *nix noob, so I'm not 100% sure of the syntax of the grep and sed commands and I can't seem to replicate what they would output from Windows.

      I can probably set this up to run on a linux VM if necessary, and I can FTP into my file server if there is a way to FTP the config from the pfSense box itself.

      If I haven't clarified everything enough let me know, it's late at night and I've just had to replace the hard drive in my pfSense box (I did have backups from the last config change I made, but I lost so much RRD data) so I'd like to get automated backups sorted to make it easier in the future. I would love to support the pfSense team by paying for a Gold account, but it's just not in my budget at the moment.

      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • D
        divsys
        last edited by

        For Windows, Winscp is the (free) utility you want.

        Roughly you'll end up with something like

        "C:\Program Files (x86)\WinSCP\winscp.com" root:<mypfspw>@ <xxx.xxx.xxx.xxx>/command "get /cf/conf/config.xml <my local="" dir="" filename="">"

        That'll get you the config.xml file, you can do a little more research and find the RRD data as well.

        You'll probably want that in a script file - the "automation" section in the Winscp FAQ has lots of hints.</my></xxx.xxx.xxx.xxx></mypfspw>

        -jfp

        1 Reply Last reply Reply Quote 0
        • J
          jabadameh
          last edited by

          Thanks for that, works no problem for automated backup. Do you have any ideas/pointers on how I can include RRD data in the XML?
          I can download it along with the XML, but adding it to the XML in a way that pfSense would restore from I wouldn't have a clue how to start.

          To anyone who has this problem also, just an addition to the steps above, you need to turn on SSH on the pfSense box, and the command starts with sftp://user:password@ip.address.goes.here/

          I'll post the contents of my batch file after everything works just in case anyone else wants to use it (although I doubt many people running pfSense will have Winblows running their file server).

          1 Reply Last reply Reply Quote 0
          • F
            fthomasr
            last edited by

            Did you get the batch file created successfully?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.