0

I am trying to take the files that I get with PuTTY's Plink command but save the file names to a text file so that I can only pull those files with PSFTP afterwards. Or can this be done without a temp text file?

The files I get are modified in the last 15 min, and I only want to get those files. I am new to PuTTY and FTP in general. I searched everywhere but cannot find anything that helps.

Any help is appreciated,

Thank you

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Abdul
  • 39
  • 1
  • 10

1 Answers1

0

You have to generate the PSFTP script file dynamically by reading the Plink output file line by line and producing a put command for each line.

See Batch files: How to read a file?


Or use an SFTP client that can directly download only files created in the last 15 minutes.

For example with WinSCP scripting:

winscp.com /command ^
    "open sftp://username:password@example.com/ -hostkey=""fingerprint""" ^
    "get /path/*>15N c:\path\" ^
    "exit"

Read about file masks with a time constraint.

(I'm the author of WinSCP)

Community
  • 1
  • 1
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992