VanDyke Software Forums

VanDyke Software Forums (
-   General (
-   -   Variables in Command Manager commands (

joey 09-21-2020 03:57 PM

Variables in Command Manager commands
I need to be able to run a command that copies a file from a system to a backup location. The source filename is always the same, but I would like the destination filename to be timestamped. (Ie., source is "flash.tar.gz", and destination would be 2020-09-21-flash.tar.gz.)

I can automate everything else with an entry in the Command Manager, but I do not see any obvious way to insert something like a timestamp. I can write a short script, but that would then require an external file (external to the VanDyke/SecureCRT settings). If there was an option within the Command Manager, it would allow a simple command like this to stay within my SecureCRT settings.

If this does not exist, is it something that could be requested? Or is this something that was always intended to be scripted, rather than a variable that can be accessed from a Command?


cboyack 09-21-2020 04:55 PM

Hi joey,

Your initial question is a bit ambiguous. Are you trying to copy a file from a remote system to a backup location on the same remote system but renamed with a timestamp?

Or, are you attempting to download a file from the remote system to your local system and then rename it with the YYYY-MM-DD addition to the name?

joey 10-01-2020 12:30 PM

Specifically, I have a file that is generated on the local system that always has the same name, like "backup.tar.gz". I would like to be able to use a command on the local system that would copy the file to another system. In order to prevent overwriting the previous backup/file, I would like to append the date to the end of the filename, so the copy on the remote system is "backup-2020-10-01.tar.gz".

An example would be:

scp /filesystem/folder/backup.tar.gz
Password: (entered manually)

This would allow the creation of the file, transfer with automatic naming at destination, then deletion of file on local system (since local system only has enough extra space to have one backup at a time).

Does that help clarify what I am trying to do? (For what it is worth, I could imagine that being able to use this sort of variable, especially if it uses a standard set of formats [similar to what Linux can do with things like %F-%T], would be useful if I was trying to move or rename files either direction.)

cboyack 10-02-2020 04:29 PM

Hi joey,

The ability to utilize variables for date/time substitution from the command-line is not a capability which is native to SecureCRT at this time.

I've added a feature request on your behalf so that the product director may be able to evaluate it for potential inclusion in some future release. I don't yet have any ETA for when or even if this might ever become available, but if it does, we will post that information here.

If you prefer direct email notification, send an email to and include Feature Request - Forum Thread #14292 in the subject line or use this form from the support page of our website.

That all being said, the capability to substitute dynamic date/time variables into a command is possible with scripting. We've just made a script with this date/time substitution capability available on the scripting forums if you wish to try it out.

All times are GMT -6. The time now is 10:22 AM.