VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Example: Send Command With Date/Time Substitutions (https://forums.vandyke.com/showthread.php?t=14304)

cboyack 10-02-2020 04:14 PM

Example: Send Command With Date/Time Substitutions
 
3 Attachment(s)
An example which 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...
Code:

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

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 to your local machine

  2. Create a Run Script Button/Command using either SecureCRT's Button Bar or SecureCRT's Command Manager
    https://forums.vandyke.com/attachmen...achmentid=1979
  3. Use your new Command/Button whenever you want to send the command with dynamic date/time substitution.
    https://forums.vandyke.com/attachmen...achmentid=1981


All times are GMT -6. The time now is 01:52 AM.