Topic "Appending of timestamp to a file if already exists in the remote folder."

Author Message
[View user's profile]

Joined: 2016-09-08
Posts: 1
Location: USA
Hi, I need to copy files from a windows machine folder to a folder in sftp server.
Here, if files already exist in that remote folder then a timestamp needs to be appended when the file was copied.
After setting the local and remote paths, I'm using put command and this is the code i'm trying to implement

put -resume -filemask="*>=1D; *%TIMESTAMP#yyyymmddhhnnss%.*" *

Plz tell me what to do. Am i going in the right direction
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
WinSCP scripting does not support any conditional operations.

Though, you can script this easily in PowerShell using WinSCP .NET assembly.

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License