help! need a cli command to send files to ftp
I'd like a one line command to send files to a specific directory on a remote ftp server. I'd like to add this to the On My Command contextual menu so that I can right click a file and select 'ftp to pictures directory', or some such, and have it ftp over. i have an account on the ftp server and dont' want to have to enter my pw - i realize the security risks of this.
Comments
> ftp -u ftp://username
This would upload those 3 files to the path on the host.
Originally posted by cybermonkey
like pyr said the ftp command in built in just type ftp in terminal to open it. then type help for a full list of commands
What he's looking for is something that will do it all in one command, which means that he won't be using interactive mode.
I have to cd to the directory the file is in first. Then
ftp -u ftp://user
and all on one line...
cd /path/to/; ftp -u ftp://user
In on my command it looks like this...
cd __OBJ_PARENT_PATH__; ftp -u ftp://user
It's really quite a powerful tool, I recommend it to anyone who does even slight cli work. There's also a quite powerful 3rd party gui editor.
OnMyCommandCM 1.5.2
OMCEdit 1.5
In on my command it looks like this...
cd __OBJ_PARENT_PATH__; ftp -u ftp://user
This only half-works. I tried it out on my FTP server, and it works if I choose to do it in the terminal (it opens up a new terminal window, and executes the commands there), but it doesn't work if I choose the script to be silent. Finder just hangs for a while, and nothing happens.
Im using the exact same script as you pasted, only with some changes to the values for pass, user, server and path.
Am I doing something wrong here ?
EDIT: I thought, maybe if I use Silent, I can only use one command at a time, and the script above sends two (the first is the cd command, the second is the ftp)
SO I figured I could change it to one command to make it work:
ftp -u ftp://user: pass@ftpserver.com/path/to/__OBJ_NAME__ __OBJ_PARENT_PATH__/__OBJ_NAME__
But this command also only works if its not set to silent. Is this a bug in the application ? I would think that it should work either way, now!
Any suggestions?
.:BoeManE:.
Originally posted by pyr3
What he's looking for is something that will do it all in one command, which means that he won't be using interactive mode.
Regardless of whether you enter your password interactively, or all in one line in the ftp URL, you still send your password via cleartext to the server.
So if you're trying to do this for security reasons, don't bother.
A better alternative is to use sftp (assuming the server you're uploading to supports it). Open up Terminal and type:
man sftp
...for more info. It's essentially a secure version of ftp