LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Silly question really about ftp command in bash (https://www.linuxquestions.org/questions/linux-newbie-8/silly-question-really-about-ftp-command-in-bash-653518/)

hashbangbinbash 07-04-2008 03:48 AM

Silly question really about ftp command in bash
 
I'm trying to use the ftp command to backup a directory on a remote machine, but the ftp command 'put' complains of the source directory not being a file. I checked the ftp command list and can't seem to find a command that will 'put' a directory, is the only way to do this by making a tarball?

Furthermore, how could I use the ftp command in a bash script, for instance with mysql I would use something like "mysql -h<hostname> -u<username> -p<password>", not very secure with the password bit, but easily improved by 'paired authentication' I think it's called. Are there flags like this for the ftp command? I couldn't find any in the manual.

tanveer 07-04-2008 04:24 AM

AFIK, you have to make it a tar/zip file to transfer.
For file transferring you can just use scp command in shell script with paired authentication between hosts.

#!/bin/sh

scp localfilename username@remotemachineip:/remotelocation


Something like that.

hashbangbinbash 07-04-2008 04:40 AM

ok, thanks!

resetreset 07-04-2008 04:47 AM

Quote:

Originally Posted by hashbangbinbash (Post 3203710)
I checked the ftp command list and can't seem to find a command that will 'put' a directory, is the only way to do this by making a tarball?



Check the help on 'mput' in ftp, I'm not sure whether that will help you. Maybe mput * is what you're looking for.


All times are GMT -5. The time now is 03:06 AM.