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

Advertisement

zenpie
Joined:
Posts:
6
Location:
USA

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

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
Thanks!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Appending of timestamp to a file if already exists in the remote folder.

WinSCP scripting does not support any conditional operations.

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

Reply with quote

Advertisement

You can post new topics in this forum