System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

ftp: connect: Connection timed out

SOLVED
Go to solution
NDO
Super Advisor

ftp: connect: Connection timed out

Hi All

Question:

I have a server that has on its crontab 2 entries in which are scripts that sends data by ftp to another server. But this target server is currently switched off (down). I´m seing inside some files in /var/spool/cron/tmp some files with the message "ftp: connect: Connection timed out". And this files on this directory are very big they are filling up /var. Would it be possible that these connection timed out be the culprit, causing /var to fill up?

I appreciate your help if you can.

Regards

F.R.
11 REPLIES
Horia Chirculescu
Honored Contributor

Re: ftp: connect: Connection timed out

If the target server is down, why are you keeping the cron jobs at all?

Best regards,
Horia.
Best regards from Romania,
Horia.
DeafFrog
Valued Contributor

Re: ftp: connect: Connection timed out

Hi ,

Find the large files in /var , and check for yourself if these files are the culprit :

cd /var
find . -xdev -size +100000000c -print
(this will print file in /var > 100Mb in size)

Reg,
FrogIsDeaf
NDO
Super Advisor

Re: ftp: connect: Connection timed out


Hi all

Horia: I have just commented out the entries of the ftp.
I´m new into the company, I cannot just go and change stuff, but I´ve done it.

the big file in /var are indeed in /var/spool/cron/tmp.

But the question still remains: does this ftp´s connection timed outs are they the ones that causing /var to fill up?

regards

F.R.
Horia Chirculescu
Honored Contributor

Re: ftp: connect: Connection timed out

> connection timed outs are they the ones that causing /var to fill up

It is hard to tell at this point.

Most of the logging is kept in /var/adm.

This directory (and sub directories from it) should be monitored permanently by you (or the designated admin of the server).

Check /var/adm/syslog/syslog.log, etc....

Best regards,
Horia.
Best regards from Romania,
Horia.
NDO
Super Advisor

Re: ftp: connect: Connection timed out

Hi

Noting suspicious on syslog.log, but those files in /var/spool/cron/tmp/ for example (croutSMCa01568) the very end of it (tail)contain the following:
ftp: connect: Connection timed out
ftp: connect: Connection timed out

lots of this entries.

regards

F.R.
Horia Chirculescu
Honored Contributor

Re: ftp: connect: Connection timed out

Those files are temporary outputs from cron jobs. (Temporary directory for files as they are written)

You could try to redirect cron jobs outputs

(with:

> /dev/null 2>&1

)

to /dev/null, to a file in /tmp, or to whatever your device has more space.


You can safely delete those files from /var/spool/cron/tmp.


Best regards
Horia.
Best regards from Romania,
Horia.
NDO
Super Advisor

Re: ftp: connect: Connection timed out

Hi!

I have been deleting them, then I have to use lsof to kill the processes of those deleted files.´
I have commented the entries in cron related to ftp to the dead machine and so far so good, /var has not grown, but I am monitoring.

regards

Fernando
Matti_Kurkela
Honored Contributor

Re: ftp: connect: Connection timed out

/var/spool/cron/tmp?

My first guess would be, each of these files is collecting input from an instance of a cron job. When the job would finish, the cron daemon would use the file to mail the output to the job's owner.

Trouble is, although the target FTP server is down, the jobs are not giving up, but seem to be retrying again and again. And the cron daemon will most likely keep restarting new instances of the same jobs, until you do something. (A variant of "sorcerer's apprentice syndrome", I think.)

Depending on how often the cron jobs are scheduled, your process table might eventually become completely filled with cron job processes. At that point, no new processes can be started... which also means no one can log in to fix the problem. If it gets that bad, the only way to fix it may be to TOC the system.

Before removing those files, use the "fuser" command on them. Check out the process IDs listed: if they are related to those cron jobs, kill the processes. At that point, the files may seem to vanish on their own (because the cron daemon will be submitting them to sendmail, which will probably push the contents first to /var/spool/mqueue, and eventually to the job owner's mailbox).

If the files are already so large the attempt to mail them would cause problems, you might want to truncate the files instead of deleting them before killing the process that is holding the file.

The simplest "command" to truncate a file is to use the output redirection operator with no command, like this:

> /var/spool/cron/tmp/bigfile

MK
MK
Dennis Handly
Acclaimed Contributor
Solution

Re: ftp: connect: Connection timed out

>Would it be possible that these connection timed out be the culprit, causing /var to fill up?

It would help if you mentioned this was a continuation of your other thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1455899

>I have just commented out the entries of the ftp.

Then you also have to kill the current jobs that are doing ftp.

>does this ftp's connection timed outs are they the ones that causing /var to fill up?
>the very end of it contain the following:
>ftp: connect: Connection timed out
>lots of this entries.

If you see that many messages in the cron jobs output, yes.

>Horia: You can safely delete those files from /var/spool/cron/tmp.

Not if the job is still running.

>then I have to use lsof to kill the processes of those deleted files.

Right. That should show you the process trees to kill.

>I have commented the entries in cron related to ftp to the dead machine and so far so good, /var has not grown

It looks like you have solved it.

>MK: the cron daemon will most likely keep restarting new instances of the same jobs

cron(1m) just starts jobs when you tell it. It knows nothing about restarting like init. Any retrying would be done by the jobs itself.
NDO
Super Advisor

Re: ftp: connect: Connection timed out

Hi all

Yes Dennis although I have closed that thread it is a continuation of the one you mention, because it was really bugging me until I put a comment on those ftp entries on the crontab. That realy solve my problem, since friday everthing is fine, and I have my sundays with no phone calls from office...

Thank you all for the support. I will assign some point as always.

regards

F.R.
NDO
Super Advisor

Re: ftp: connect: Connection timed out

bye