Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-02-2020, 04:14 PM
cboyack cboyack is offline
VanDyke Technical Support
 
Join Date: Apr 2020
Location: Albuquerque, NM
Posts: 59
Post Example: Send Command With Date/Time Substitutions

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
  3. Use your new Command/Button whenever you want to send the command with dynamic date/time substitution.
Attached Images
File Type: png RunScriptCommandPropertiesExample.PNG (14.8 KB, 125 views)
File Type: png CommandManagerDateTimeSubstitutionExample.PNG (42.4 KB, 114 views)
Attached Files
File Type: txt SendCommandWithDateTimeSubstitutions.py.txt (3.5 KB, 82 views)
__________________
Thanks,
--Cameron

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Closed Thread

Tags
example script


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:52 PM.