Topic "Need to move files from one folder to the other, renamed with timestamp."

Author Message
Harsh Narula
[View user's profile]

Joined: 2015-07-13
Posts: 1
Location: New Delhi, India
Hi All,

I need to move files from one SFTP remote location to the other.
I have been able to do that using the mv command.

However, I'm facing a problem. The move command is unable to overwrite files if by any chance I have files which are coming with same names. Is it possible to anyway, add a timestamp in the filename, this can help me remove any duplicate file-name issues.

PS: It has to be a solution through WinSCP scripting only. I cannot use .net/powershell.

Thanks in advance!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
You can use:

mv /path/file.txt /another/path/file.%TIMESTAMP%


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