- 1 year ago
Timestamp and Increased levels of verbose logging using PSFTP
In PSFTP, which is a command-line SFTP client for Windows, you can use the -b
option to specify a script file that contains the commands you want to execute. You can create a script file with the desired commands and pass it to PSFTP using the -b
option.
To include a timestamp and increased levels of verbose logging in PSFTP, you can modify your script file to add the necessary commands. Here's an example:
- Create a script file, e.g.,
myscript.txt
, and open it in a text editor. - Add the following commands to the script file:
bash!echo %DATE% %TIME%
!echo "Verbose on"
verbose on
The !echo %DATE% %TIME%
command outputs the current date and time as a timestamp. The !echo "Verbose on"
command prints a message indicating that verbose logging is enabled. The verbose on
command enables verbose logging in PSFTP.
Save the script file and exit the text editor.
Open a command prompt and navigate to the directory where
psftp.exe
is located.Run the following command to execute the script file:
csspsftp.exe -b myscript.txt [other options]
Replace [other options]
with any additional options you want to pass to PSFTP.
PSFTP will execute the commands in the script file, and you should see the timestamp and verbose logging output in the console.
Note that the exact commands and options may vary depending on the specific version of PSFTP you are using. Please consult the PSFTP documentation or the help documentation (psftp.exe -h
) for more details on the available options and syntax.