Quantcast
Channel: THWACK: All Content - Network Configuration Manager
Viewing all articles
Browse latest Browse all 6057

Got those configs in your database and filesystem? Want to copy them elsewhere securely via Windows Task Scheduler?

$
0
0

My solution uses PKI and putty utility pscp.exe so that I can securely copy configs for the day from the filesystem to a server for archiving.  As my configs hit the filesystem with filenames ending in Running.Config, the argument I use searches for files with that in the name.  Also requires a timestamp of the current date (the '/d 0' part below).

Create a Windows scheduled task with action:

 

Start a program

Program / script: C:\Windows\System32\cmd.exe

Add arguments: forfiles /p D:\SolarWinds\Config-Archive\ /s /m *Running.Config* /d 0 /c "cmd /c D:\Putty\Pscp.exe -i D:\Putty yourcertname.ppk @path username@destinationserver/where/ever/you/want/"

Start in:  D:\SolarWinds\Config-Archive\

 

The target server's certificate will need to be already cached by the SolarWinds server for the service account running the job.  This can be done via psexec, via the registry, or (the easiest way) prepend the pscp command with 'echo y |' to accept the cert that the target server will prompt for acceptance.

 

Update:  I have since rewritten my solution so that a date string variable is created based on current date.  My script removes the 0 for single digit months (Jan - Sep) so that the format NCM saves configs in is the same as the format expected by my Windows 2008 server uses by default for its date format.  Someone before me had already done the heavy lifting with a few for statements to get an integer for month and for date.


Viewing all articles
Browse latest Browse all 6057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>