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

    Backup / restore config.xml on the command line

    Scheduled Pinned Locked Moved General pfSense Questions
    3 Posts 3 Posters 6.8k Views
    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.
    • R Offline
      ren22
      last edited by

      Hi,

      is there any command to backup or restore the config.xml on the command line?
      I mean if i only want the config.xml and the not the package configuration as example.

      thanks

      1 Reply Last reply Reply Quote 0
      • jimpJ Offline
        jimp Rebel Alliance Developer Netgate
        last edited by

        There isn't a way to filter out the package info from the command line (well, easily… there probably is with a piped chain of various shell commands)

        You can just grab the config.xml from /conf/ and cp/scp/etc it wherever you want. If you want to remove the package settings, just edit out the " <installedpackages>...</installedpackages> " section of the configuration.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • M Offline
          muswellhillbilly
          last edited by

          I run a cron job to backup my config.xml to a local ftp server. Example below:

          #!/bin/sh
          cd /conf
          cat <<end |="" ftp="" 'ftp:="" login:password@ftp.server.com="" backup'<br="">put ./config.xml
          END

          To restore, just run a manual ftp session to the backup server and pull down the last good config, removing the package info as jimp suggests.</end>

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