- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
06-22-2018 01:35 AM - edited 06-22-2018 02:04 AM
Hey!
I'm using curl and the xml api to automtically backup the config of my PA-3020:
However, the content of that file looks completely different compared to a manual backup. device -> setup -> operations -> save and export named configuration snapshot.
automatic backup: 1.000 lines
manual backup: 27.000 lines
automatic backup: file type: xml file
manual backup: file type: file
automatic backup: very cryptic
manual backup: compete config in cleartext
What's the deal?
06-22-2018 06:37 AM
Are you running the command through curl or wget?
Have you tried simply performing the fetch in a browser to see what the 'normal' output looks luke:
https://<IP>/api/?type=export&category=configuration&key=<KEY>
06-26-2018 02:37 AM
I'm running the command through curl -kG
The fetch in the browser is normal.
06-26-2018 03:04 AM
Have you tried running the command from a different machine? Since the command works fine from a browser, the issue is likely how curl writes to the file. Maybe there's a local buffering issue or file access issue,...
06-26-2018 03:22 AM - edited 06-26-2018 03:24 AM
I'm running the curl command from an Ubuntu system.
I'm doing the https access from firefox of my windows 10 machine.
But https acccess isn't the same a curl, is it?
You also spoke about wget.
What am I supposed to do now?
I just followed the manual.
06-26-2018 03:47 AM
curl simply launches an address the same way a browser does. we established the command you put in curl does work properly when put into a browser, next up is trying to determine why curl appears to write only part of the config received from API
do you get a longer config file if you try without the trailing "> running-config.xml"
as I just ran through the basic troubleshooting steps myself: did you count lines or characters?
the API export in a browser (and the one fetched from a config export) nicely respects XML 'markup' while the curl 'write' will simply drop everything in a flat file so where the XML nicely lists a single attribute per 'line' the curl output will have everything on the same line inless the config contains a break
07-02-2018 05:40 AM
@reaper wrote:
do you get a longer config file if you try without the trailing "> running-config.xml"
No, that doesn't make a difference.
@reaper wrote:as I just ran through the basic troubleshooting steps myself: did you count lines or characters?
the API export in a browser (and the one fetched from a config export) nicely respects XML 'markup' while the curl 'write' will simply drop everything in a flat file so where the XML nicely lists a single attribute per 'line' the curl output will have everything on the same line inless the config contains a break
I think you are right. It's the markup. I imported such a config into the firewall and I was able to load and commit the configuration. So everything is fine. Thank you!
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!