LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-16-2011, 05:42 AM   #1
ckiran04
LQ Newbie
 
Registered: Apr 2008
Posts: 21

Rep: Reputation: 0
unable to copy data to remote server using ncftp command


Hi ,
Some one please help me . I am unable to use ncftp command
I have defined all variables used. i have to copy the data to another server FTPS.

When i am executing this command it is throwing error

ncftp -u : option unknown

I am copying total script what i am executing in my server. Please some one tell me is there any pistake in using the
ncftp command ,
or tell me some other commands to copy data to remote server

BAK="/opt/DBbackups"
NOW=$(date +"%d-%m-%Y")

FTPU="username"
FTPP="password"
FTPS="server IP adress"


### UPLOADING BACKUP FILES TO FTP SERVER ###
ncftp -u "FTPU" -p "FTPP" $FTPS<<EOF
mkdir $NOW
cd $NOW
lcd $BAK
mput *
quit
EOF
 
Old 07-16-2011, 06:47 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

First thing I noticed: You forgot the $ in 2 places:
Code:
ncftp -u "$FTPU" -p "$FTPP" $FTPS<<EOF
Hope this helps.
 
Old 07-16-2011, 07:06 AM   #3
ckiran04
LQ Newbie
 
Registered: Apr 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks for the replay druun

Actually by mistake it was deleted in post.
In my script it is there.

Please can you tell me some other commands which help in data transfer to remote desktop
 
Old 07-16-2011, 07:32 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

It works on my side if I recreate your script. Can you post your full script and use code tags. I.e.: [code]script goes here[/code]

You might want to try using ftp instead of ncftp. Try the following:
Code:
#!/bin/bash

BAK="/opt/DBbackups"
NOW=$(date +"%d-%m-%Y")

FTPU="user"
FTPP="password"
FTPS="ipnumber"

### UPLOADING BACKUP FILES TO FTP SERVER ###
ftp -n $FTPS <<EOF
user $FTPU $FTPP
prompt
mkdir $NOW
cd $NOW
lcd $BAK
mput *
quit
EOF
Hope this helps.
 
1 members found this post helpful.
Old 07-17-2011, 08:29 AM   #5
ckiran04
LQ Newbie
 
Registered: Apr 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks druuna. it working but giving error that
Interactive mode off. Local directory now /opt/Dbbackups

Can you give any suggestion to make this with out any errors.
But i am able to get the Data to the remote server.

Thanks a lot
 
Old 07-17-2011, 08:41 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

This is not an error. The prompt command turns off interactive mode, and this fact is echoed to screen.

BTW: You're welcome
 
  


Reply

Tags
ftp, ncftp, script



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
[ncftp] how to delete oldest directory and file using ncftp commands booyeeka Linux - Newbie 3 08-17-2010 11:23 AM
dd command for remote disk copy tukidid Linux - Newbie 1 01-20-2010 08:39 PM
secure copy a latest data file from the remote host spkandy Linux - Networking 4 08-08-2009 02:46 AM
how to copy files from a remote server man1979 Linux - General 3 08-16-2005 06:08 AM
copy files from a server to another..both remote Santosh_d Linux - Networking 1 03-09-2004 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:06 PM.

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