VanDyke Software

Scripting Examples

Index

Send Command With Date/Time Substitutions

This example script allows SecureCRT to automatically convert date/time substitution parameters (e.g., %Y, %M, %D, etc.) when sending a command.

For example, the following command template...

scp /filesystem/folder/backup.tar.gz  usr@server.example.com:/backups/backup-%Y-%M-%D_%h%m%s_%t.tar.gz

... would become ...

scp /filesystem/folder/backup.tar.gz  usr@server.example.com:/backups/backup-2020-10-02_111327_253.tar.gz

... if the command was sent on Oct 2, 2020, just past 11:13:27 AM.

How to get started with this example script:

  1. Download and save this example script, SendCommandWithDateTimeSubstitutions.py.txt, to your local machine.
  2. Create a Run Script button or command using either SecureCRT's button bar or SecureCRT's Command Manager.

  3. Use your new command or button whenever you want to send the command with dynamic date/time substitution.


Example Script

SendCommandWithDateTimeSubstitutions.py.txt (3.5 KB)

 

VanDyke Software uses cookies to give you the best online experience. Before continuing to use this site, please confirm that you agree to our use of cookies. Please see our Cookie Usage for details.