IRONPORT icon   Ironport – Schedule automation scripts on Windows

On a previous post I explained how to Automate Ironport commands / scripts from Windows. At the end of the post I suggested configuring the task scheduler to execute a bat script, for example, to save a backup copy of the configuration… So, here we go!

Example 1: Simple configuration backup via email

Assuming all the necessary preparations are made, we should have a folder with the private key and some downloaded tools:
Folder with tools and generated public and private keys to connect to Ironport appliance

So, for example, this simple command forces the delivery of the configuration file to an email recipient:

D:\SCRIPTS\IRONPORT> plink.exe MYIRONPORT -i IRONPORT.ppk -l admin "mailconfig"

By scheduling the execution of this command, every day, or week (whatever you want), a backup of the Ironport would be made:
Scheduling a task to send the Ironport configuration file to email

ArgumentsMYIRONPORT -i IRONPORT.ppk -l admin "mailconfig"

Everytime the task is executed the configuration would be received on our email client…
Ironport ESA configuration file received via email


Example 2: Configuration file backup

In this example, a configuration file backup will be copied to a predefined folder (for example, to a UNC path in a shared folder on our file server).

A batch script is needed in order to get this work. I have called it CONFIG_BACKUP.bat:
Folder with tools and generated public and private keys to connect to Ironport appliance

This is the code:

@echo off

set TODAY_DATE=%date:~-4,4%%date:~-7,2%%date:~-10,2%

plink.exe MYIRONPORT -i IRONPORT.ppk -l admin "saveconfig 3 yes"
pscp -i IRONPORT.ppk admin@MYIRONPORT:/configuration/*%TODAY_DATE%* MYIRONPORT_%TODAY_DATE%.xml

move *.xml %BACKUPS_PATH%\

The only customization is setting the BACKUP_PATH variable for you environment (it can be either a UNC or standard path). The script:
– executes the Ironport "saveconfig 3 yes" command to save a copy of the configuration on the appliance itself
– and then copies it to the defined path.

If executed manually. this would be the ouput:


File written on machine "" to the location
Configuration saved.
MYIRONPORT_20160719.xml        | 158 kB | 158.9 kB/s | ETA: 00:00:00 | 100%
        1 file(s) moved.

To schedule the execution:
Scheduling a task to backup the Ironport configuration file


Everytime the task is executed, a new configuration file with the date will be added to the configured path:
Ironport configuration file backed up

2 thoughts on “Ironport – Schedule automation scripts on Windows

  1. Nice article! It greatly helped me to back up my IronPort devices.
    Thanks a lot!

    I also tried to include a command to remove the generated config file from the IronPort device, but IronPort returns an error saying “you do not have access to the rm command.”
    According to some Cisco engineers on support forums, the only ways to remove such file is to do it manually through FTP or asking TAC to manually remove it.

    Because the backup files are only 250KB, it is finally not a big deal to keep them on device.


Leave a Reply

Your email address will not be published. Required fields are marked *