LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   unable to copy data to remote server using ncftp command (https://www.linuxquestions.org/questions/linux-server-73/unable-to-copy-data-to-remote-server-using-ncftp-command-892009/)

ckiran04 07-16-2011 05:42 AM

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

druuna 07-16-2011 06:47 AM

Hi,

First thing I noticed: You forgot the $ in 2 places:
Code:

ncftp -u "$FTPU" -p "$FTPP" $FTPS<<EOF
Hope this helps.

ckiran04 07-16-2011 07:06 AM

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

druuna 07-16-2011 07:32 AM

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.

ckiran04 07-17-2011 08:29 AM

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

druuna 07-17-2011 08:41 AM

Hi,

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

BTW: You're welcome :)


All times are GMT -5. The time now is 11:17 PM.