![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| executing Unix script that contains CURL FTP commands from Peoplesoft Process Schedlr | sfedak | Shell Programming and Scripting | 2 | 02-18-2009 02:20 PM |
| child process state | smreddy | UNIX for Dummies Questions & Answers | 8 | 12-24-2007 12:51 AM |
| The State of Unix (Addict 3D) | iBot | UNIX and Linux RSS News | 0 | 06-18-2007 11:40 PM |
| The state of Unix - ZDNet.com blogs | iBot | UNIX and Linux RSS News | 0 | 06-18-2007 04:40 AM |
| Process State | ianlow | UNIX for Dummies Questions & Answers | 1 | 09-06-2006 11:11 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Unix script (sh): state of ftp process
Hi guys,
I’m writing a script in which I have to get file from a remote host by ftp. The problem is that the remote machine could be very slow, not connected or ok. To resolve this problem, I write this: [……] echo "verbose on" > ftprap.cmd echo "prompt " >> ftprap.cmd echo "ascii" >> ftprap.cmd echo "passive off" >> ftprap.cmd echo "mget * " >> ftprap.cmd echo "quit" >> ftprap.cmd ftp %IP < ./ftprap.cmd > ftp.log 2>&1 & PID_FTP=`echo $!` sleep 60 ps -o pid,tty,time,cmd,state|grep -E "$PID_FTP%S" >/dev/null 2>/dev/null if [ $? = 0 ] then kill -9 $PID_FTP >> ftp.log 2>&1 fi [……] To kill ftp only if it is blocked. It happens that even if ftp runs, ps shows me with state = S, that is sleeping!!! I try to run the script with “sleep 1”, while it’s transferring a lot of file, and I’m sure of this: ps shows ftp is sleeping and then the script kills it. I’m not so very expert about unix scripting, so I don’t’ know where I make mistakes. Would you help me? Thanks in advanced. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|