Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

mlist

Host has not answered for more than 15 seconds - SOLVED!

Hi prikryl

yes you were right! It was my mystake....now selection stored section and increasing timeout as suggested ALL MY SCRIPT WORK CORRECTLY!

Thanks for your great work!
martin

mlist wrote:

I tried to increase timeout to 3600 seconds but the problem is still present

How have you done that? You open session 'sftp://root:mypass@10.39.131.100'. I doubt its name of the stored session, when the longer timeout may have been stored.
mlist

I tried to increase timeout to 3600 seconds but the problem is still present

I tried with another script that execute a tar on another remoter server (increasing timeout from winscp gui to 3600) but I have the same problem.

This is my script:
-------begin script-----
option batch on


# Disable overwrite confirmations that conflict with the previous
option confirm off

# Connect
# [(scp|sftp)://][user[:password]@]host[:port][/path/[file]] [/privatekey=key_file]
# open sftp://tmpupusr:T3mpupusr@10.39.132.150
open sftp://root:mypass@10.39.131.100

# Change remote directory
cd /var/www/

# Remove old backup file
rm *.tar.gz

# Change local directory
lcd Z:\
lcd Backup\MIRHWB01

# Force binary mode transfer
option transfer binary

# Execute backup remotely
call sudo tar -zcvf mirhwb01_iad_bck_.`date +%Y%m%d`.tar.gz iad/

# Download file to the local directory Z:\
get *.tar.gz

# Disconnect
#close
----------end of script----------

This is error message:
iad/common/bin/mrtg/mrtg-check-cpu.sh
iad/common/bin/mrtg/mrtg-check-jdk-threads.sh
iad/common/bin/iad
iad/common/common.tar.gz
Host has not answered for more than 15 seconds. Still waiting...
Warning: Aborting this operation will close connection!
(A)bort: Abort
Terminated by user.
Session 'root@10.39.131.100' closed.
No session.
No session.

Please note that editing timeout setting from winscp gui show 3600 as seconds thus...it seems to ignore my setting!
Is there a way to configure it from script? I don't understand why timeout setting is ignored
martin

I finally understand. The "Host has not answered for more than 15 seconds" message is not caused the by the "get" command, but rather by "call" command, because the dump takes too long. Try to set longer timeout. You would need to do that by pre-configured stored session.
mlist

prikryl, I apologize!

I didn't correctly read your question
Yes mysqldump is still running when winscp call command finish.
What can I do to force wiscp "wait" the end of mysqldump?

Thanks
martin

mlist wrote:

No, no other dumps or zip commands are executed.
I'm sure about this because I'm the administrator of the server and moreover executing "ps -ax | grep mysql" or "ps ax | grep zip" or "w", the only process active is the remote script.

That's what I think. I was asking whether the processes are still running when the WinSCP "call" command finishes.
mlist

No, no other dumps or zip commands are executed.
I'm sure about this because I'm the administrator of the server and moreover executing "ps -ax | grep mysql" or "ps ax | grep zip" or "w", the only process active is the remote script.

As explained the strange thing is that "get file" begin before the dump.tar.gz is completed. I think this could be the problem but...I don't know how TO FORCE my script to wait until dump is completed.
I'm not an expert but when I write vbscript I use for example:
command..., 0, True (that force my script to stop until command is executed.)
I think also that is necessary to know how to debug error message:
Host has not answered for more than 15 seconds. Still waiting...
Or..to know the possible reasons that cause this error.

I tried to reboot the server and I did lot of retry on windows but..nothing is changed
martin

Re: Error executing script: what's wrong?

mlist wrote:

One useful thing to know in order to understand the problem is that when this error is displayed, executing "ls -lh" on remote server shows that dump file still continues to grows

At that time, are the processes that create the file (mysqldump or gzip) still running?
mlist

Error executing script: what's wrong?

I'm trying to execute a script that remotely execute a mysql dump and then get generated files but it doesn't work. I already tried different syntax but I didn't find a solution
Could someone give me a tips?

This is my script:
-----script-----
option batch on

# Disable overwrite confirmations that conflict with the previous
option confirm off

# Connect
# [(scp|sftp)://][user[:password]@]host[:port][/path/[file]] [/privatekey=key_file]
# open sftp://tmpupusr:T3mpupusr@10.39.132.150
open sftp://root:mypass@10.39.132.140

# Change remote directory
cd /usr/Backup/Mysql

# Remove old backup file
rm max_db_dump.sql.gz

# Change local directory
lcd Z:\
lcd Backup\MICSAD2

# Force binary mode transfer
option transfer binary

# Execute backup remotely
# call /usr/bin/mysqldump -uroot -hlocalhost -pmypass max > max_db_dump.sql
call /usr/bin/mysqldump -uroot -hlocalhost -pmypass max | gzip -c > max_db_dump.sql.gz

# Download file to the local directory Z:\
get max_db_dump.sql.gz

# Disconnect
close

# Exit WinSCP
exit
------end of script-----

The problem is that on remote server (10.39.132.140) mysql dump and .gz file is created correctly but an error is displayed when getting file.
It seems that winscp for some strange reason isn't able to get the file.
This is the error:
Host has not answered for more than 15 seconds. Still waiting...
Warning: Aborting this operation will close connection!
<A<bort: Abort
Terminated by user.
Session 'root@10.39.132.140' closed.
No session.
No session.
Unknown command '#close'.
Unknown command '#exit'.
winscp>

One useful thing to know in order to understand the problem is that when this error is displayed, executing "ls -lh" on remote server shows that dump file still continues to grows; thus I suspect that "get" begin before gz file is completely created. I tried to don't create a .gz file using standard mysqldump sintax (call /usr/bin/mysqldump -uroot -hlocalhost -pmypass max > max_db_dump.sql) but the problem is always the same
Obviously I have thought that I must find a way to put some sleep (although I don't know how to do it...) but I have others script that remotely create a gz file and they work perfectly.
For example I have scripts like this:
# Execute backup remotely
call sudo tar -zcvf micsad1_openads_bck_.`date +%Y%m%d`.tar.gz max/

# Download file to the local directory Z:\
get *.tar.gz

and this script work perfectly! Tar.gz file is created and THEN (after gz is finished) the get begin.
I searched on the forum problems related to "Host has not answered..." but I thing posts are related to others things...

Do you have any suggestion?
:(
Thanks