Time Change on NetScaler Reboot
Change Time manually on NetScaler
To change time and date on NetScaler, run the below command on NetScaler putty shell.
YY = Year
MM = Month
DD = Day
HH = Hour
MM = Minutes
date +val 2208011111. This will set time as august 1st 2022.
On newer netscaler machines, if you run above command, post reboot, time will change automatically. This is tested on NetScaler 13.1 37.38 and NetScaler 13.1 42.47 versions. Post reboot time will change automatically.
For licensing issue, or for whatever reason if you’d like to set the new time to stick automatically on reboot, create a cron job to run the above command every second. In cron, if you use
* * * * * SomeCMD, it wont run forever. So use
sleep 1 command, which waits for 1 second and runs the command.
crontab -e command on NetScaler putty shell. It will open cron in edit mode in VI editor. Copy below code and paste it to the putty console. Reboot netscaler and check.
* * * * * sleep 1; date +val 2208011111
There are other ways like
- creating a file called nsbefore.sh in /nsconfig/ folder and adding the same date command to it
- creating a file called nsafter.sh in /nsconfig/ folder and adding the same date command to it
When above options were used, none of them worked in maintaining the time consistently post reboots. Only crontab command worked.
Want to learn more on Citrix Automations and solutions???
Subscribe to get our latest content by email.