Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 748
  • Last Modified:

Windows PowerShell FTP question

Good day

I am working on Windows PowerShell script
I have to find the oldest file out of several files with specific name pattern (say file_1234, file_0989, file _0909) from Linux box and transfer to Windows 7 machine
My PowerShell skills are rusty

Would appreciate any help

Thank you,

Alex


0
mattyinteractive
Asked:
mattyinteractive
1 Solution
 
AlexPaceCommented:
I know this isn't what you asked for but since nobody else responded yet here is a Robo-FTP script to get the oldest file matching file_1234:
FTPLOGON "ftp.linuxserver.com" /user="userID" /pw="secret"
GETSITEFILE "file_1234*" /oldest
RCVFILE %sitefile
FTPLOGOFF

Open in new window

0
 
mattyinteractiveAuthor Commented:
Alex,

thank you. I had solved the problem by adding timestamp to filename on the server side
After that I was getting file listiing via ftp "dir" command, sorted ascending and getting last entry
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now