[svlug] Problem in SSH !
Anagha Tongaonkar
yogiana_t at yahoo.com
Wed Aug 3 10:05:42 PDT 2005
Hello Folks,
Thank you for your replies on the FTP problem. The use of
"bin" mode indeed solved the problem.
Now, I am running into next problem that is: after the file
transfer using FTP, I ssh into machine B and then try to
run an executable "Compress" on machine B. However, the
executable is not executed completely, it just hangs
halfway. If I run the same execuatble on command line on B,
it works fine, but if I ssh into B from A (through bash
script) and then try to run the executable, it just doesn't
run completely.
Any idea, what can be done to resolve this problem?
Thank you,
Anagha
--- Dan Martinez <steeljack at gmail.com> wrote:
> Anagha Tongaonkar wrote:
>
> > I am using a bash script that uses ftp command to
> transfer
> > file "report.txt" from machine A to machine B.
> > However, after executing this script, at the receiving
> end
> > the file size seems to have increased.
> >
> > Source
> > report.txt on machine A:
> > -rw-rw-r-- 1 user group 1166 Aug 2 17:35
> > report.txt
> >
> > After FTP using the bash script:
> > Destination
> > report.txt on machine B:
> > -rw-r--r-- 1 uesr group 1232 Aug 03
> 00:36
> > report.txt
> >
> >
> > As you can see the destination file size (1232) is
> greater
> > than the source file size (1166).
> >
> > Any idea, why is the file size different on the source
> and
> > destination?
>
> First guess: FTP is not running in "binary" mode, and is
> therefore
> converting linefeeds characters to
> linefeed/carriage-return pairs.
>
> Within the context of your script, you might try adding
> the command
> "binary" (without quotes) right after you log in with the
> "user"
> command.
>
> If that doesn't work, more information would be helpful.
> What type of
> hosts are machine A and machine B? What does the file on
> machine B
> look like?
>
> In general, FTP is probably not the best tool for copying
> a single
> file between hosts which you have authorization to use. I
> would use
> scp, or rsync-over-ssh. Either of these should resolve
> the
> binary-versus-non-binary problem. With a
> properly-configured
> ssh-agent, they would, as a bonus, obviate the need to
> type your
> password every time you wanted to transfer a file.
>
> Cheers,
> Dan
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the svlug
mailing list