LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-04-2008, 03:48 AM   #1
hashbangbinbash
Member
 
Registered: Mar 2008
Posts: 108

Rep: Reputation: 16
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.
 
Old 07-04-2008, 04:24 AM   #2
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Rep: Reputation: 39
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.
 
Old 07-04-2008, 04:40 AM   #3
hashbangbinbash
Member
 
Registered: Mar 2008
Posts: 108

Original Poster
Rep: Reputation: 16
ok, thanks!
 
Old 07-04-2008, 04:47 AM   #4
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quote:
Originally Posted by hashbangbinbash View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash scripting silly question itz2000 Programming 5 05-09-2007 07:57 PM
silly bash question bennethos Programming 1 03-25-2006 09:46 AM
bash, command line ftp, and a delimma.. scoob8000 Linux - Networking 2 03-18-2005 05:22 PM
silly bash/aterm ctrl+l question jipe Linux - General 0 01-05-2004 06:43 AM
bash command question BajaNick Linux - Software 8 10-05-2003 07:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration