different content of backup files.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

different content of backup files.

L4 Transporter

Hey!

I'm using curl and the xml api to automtically backup the config of my PA-3020:

https://live.paloaltonetworks.com/t5/Management-Articles/How-To-Backup-of-Config-Files-Periodically-...

 

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?

6 REPLIES 6

Cyber Elite
Cyber Elite

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>

 

Tom Piens
PANgurus - Strata specialist; config reviews, policy optimization

I'm running the command through curl -kG

 

The fetch in the browser is normal.

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,...

Tom Piens
PANgurus - Strata specialist; config reviews, policy optimization

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.

 

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

 

 

 
Tom Piens
PANgurus - Strata specialist; config reviews, policy optimization


@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!

  • 4026 Views
  • 6 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!