Jump to content

How can I get the current date while in a ssh session to the NetScaler?


Gear Mesh 3

Recommended Posts

When I back up my configs before an update, one of the commands I run is this:

create system backup nsconfig_full_backup_2022-12-25 -level full -comment "Backup before Firmware Upgrade-2022-12-25"

But I'd rather not enter today's date, I'd rather have the system get it programmatically.

Is there a way to get the date and put it in a variable to replace the hard coded date?

I tried this code but it ERRORED out:

create system backup nsconfig_full_backup_$(date +%Y-%m-%d) -level full -comment "Backup before Firmware Upgrade-$(date +%Y-%m-%d)"

I am currently running 13.0 code if it matters.

Link to comment
Share on other sites

There is no way to read the variable in any of the builds. 

But if the name of the backup is not specified, it will automatically create the backup file with the current timestamp.

create system backup -level full -comment "Backup before Firmware Upgrade-2022-12-25..."

"show system backup" will display the name of the file, creation time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...