Bash script ftp files
This is totally confusing. How do I get out of this End-Of-Session thing? Why not input directly to the ftp prompt that comes without that? Pelle Nilsson Pelle Nilsson 8 8 silver badges 9 9 bronze badges. This is the simplier solution. But neither is lftp. Install ncftpput and ncftpget. They're usually part of the same package. Paul Tomblin Paul Tomblin k 56 56 gold badges silver badges bronze badges.
Adam the "connection won't be encrypted" etc is a consequence of using FTP, which was specified in the question. It's going to happen no matter what FTP client you use. Chizhik Chizhik 1 1 silver badge 1 1 bronze badge. Which version of ftp are you using? It does not work on ubuntu 18 — synek Use this to upload a file to a remote location:! Shal Shal 5 5 silver badges 7 7 bronze badges. This is a fairly late answer to not be using.
An explanation would be in order. For example, how is it different from previous answers? At the moment this writes to a file 'ftp' and doesn't spawn an ftp process — Brian Agnew. Also, hardcoding passwords in cleartext is a bad idea. I'm sure the password issue is for illustrative purposes — Brian Agnew. Load Comments. What's New. Most popular in Linux-Unix. More related articles in Linux-Unix. We use cookies to ensure you have the best browsing experience on our website.
Start Your Coding Journey Now! Login Register. Is there anything cleaner than that? I know this is an old one, but you can also pass arguments to a command with a Here Document. You said that you are not interested in other tools, but scp is a much better choice for unattended file transfers. Here is an scp example:. I don't know how sftp was configurable when this question was asked. Anyway, 6 years later, you can put sftp-commands like PUT into a file and then reference this file in your initial sftp-call.
The makes the whole process completely non-interactive and easily configurable:. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Search Forums. Show Threads. Show Posts. Shell Programming and Scripting.
Shell Scripting for creating ftp and transfer file. Preeti Saini. Registered User. Join Date: Aug Dear All, We run backup script to update backup file every hour.
I want to create a script, which transfer these files in another server using ftp as new backup file created every hour. Files should be stored with a unique name for every hour e.
Please let me know how can I create script for that. It would be very thankful l if anybody help me on this. Please check similar posts at the bottom of this page. You should get some idea on the approach.
Join Date: Jun Code :.
0コメント