Only download most recent file .scp ftp






















Show Threads. Show Posts. Find the latest file on remote sftp. Registered User. Join Date: Jan Hi All, I need your help in finding the latest files in remote sftp and get those files to local server and process them. Please let me know I appreciate your valuable inputs. Thanks raj. Join Date: Jul Code :.

Last edited by mukulverma; at PM.. Reason: modification. Join Date: Aug You can get a list of files this way I think, though you will need to check if ls -t works in your sftp. It works in mine, but sftp can vary, and does not run real shell commands. Find all posts by Corona Hi , Thanks for your replies.

It says connecting to sftp but is not returning any values and not getting any files I need to get all the latest. Read my code, don't just blindly copy it. I didn't see much point writing more until I knew whether your sftp would use ls -t. Try below steps:- 1. Create an sftp batch file: Code :.

Find all posts by Yoda. It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. I'd like to run an scp transfer to download the latest newest file in a certain directory to my local directory.

If you want something that's more intelligent about copying files you'll need to use a tool such as rsync. This will only copy files that are missing or have changed from rimmer.

Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Learn more. How to download the latest file in a folder using a scp? Ask Question. Asked 8 years, 4 months ago. Active 4 years, 6 months ago. Viewed 25k times. Something like this: source : root rimmer. Improve this question. Giacomo 1 1 silver badge 9 9 bronze badges. Enjoy this tip?

Subscribe to our newsletter! Thank you! You have successfully joined our subscriber list. Steve says:. February 20, at pm. Bela says:. November 10, at pm. July 19, at pm. Rob says:. November 8, at am. Leave a Reply Click here to cancel reply.



0コメント

  • 1000 / 1000