Download files with specific date from SFTP server using PSFTP [closed]

StackOverflow https://stackoverflow.com/questions/23226383

  •  07-07-2023
  •  | 
  •  

Вопрос

How can I download files of a specific time period through PSFTP?

When I do mget *.*, it downloads all the files into local folder. Now I’m not allowed to delete these files from SFTP server or move them. So every time I download, it has to download the complete list.

Is there a way where I can download only those files through mget which are a week old?

Это было полезно?

Решение

PSFTP does not support time-based file selection.

You can use scripting interface of WinSCP instead.
It supports time-constraints in file mask.

To download all week old (7 days old) files, use the following command:

get *<7D

See the guide for converting PSFTP script to WinSCP script.

For general introduction to WinSCP scripting see:
https://winscp.net/eng/docs/guide_automation

See also similar question WinSCP time based file download.

(I'm the author of WinSCP)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top