Backup ftp picture

Advertisement

pierrelaforce
Joined:
Posts:
2

Backup ftp picture

Hello to all of you

I would like to save camera images recorded on an FTP server.
The cameras loop 100 images, one every 15 minutes.
So image0001, image0002 ...etc until image0100 and starts again at image0001.
I would like to make a backup of the most recent files every day but not to overwrite the files, I would like to rename the files as follows: images0001_timestamp.jpg of course automatically.

I already have a functional script for another task that I modified for this one but I have difficulty with the timestamp.
This is the order:
get -neweronly -preservetime /var/www/cameras/* D:\Backup\cameras\sauvegardes
If someone has a solution that could help me, I thank them in advance

Have a good day

Translated with www.DeepL.com/Translator

Reply with quote

Advertisement

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

Re: Backup ftp picture

WinSCP won't do such a custom rename for you. You will have to script it.

You can replace your script with PowerShell code.
https://winscp.net/eng/docs/library_from_script

In the PowerShell code, you can use Session.CompareDirectories to find the new/updated files
https://winscp.net/eng/docs/library_session_comparedirectories
You can then rename those that exist locally already and only then download the new version.

Reply with quote

Advertisement

You can post new topics in this forum