![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| verify if a process exists (ps) | melanie_pfefer | Shell Programming and Scripting | 4 | 04-05-2008 01:34 PM |
| File exists with Permissions | Jose Miguel | Shell Programming and Scripting | 2 | 04-16-2007 09:07 AM |
| Directory exists | tez | UNIX for Dummies Questions & Answers | 3 | 08-11-2006 04:46 AM |
| Folder Exists | borncrazy | UNIX for Dummies Questions & Answers | 5 | 06-18-2004 10:48 PM |
| : /var/adm/utmp exists! | dangral | SUN Solaris | 2 | 02-27-2004 08:17 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
process already exists
I'm attempting to modify a script that ftps files from one machine to another (see this post ). I've been testing it a few times, and once I had to kill the test because it was taking forever, and I know it wasn't working. Now, when I try to test the script again, I'm getting the following:
$ ./move_logs_test3.sh ./move_logs_test3.sh[18]: process already exists As a result, I can't test my script. -How do I determine what this process is? -How do I remove it? -How do I prevent this from happeneing again? Thanks for your help! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Post the script exactly as you have it. The line number does not tally with the script you referenced. It is most likely that your ftp co-proccess is still running.
|
|
#3
|
|||
|
|||
|
process already exists
My code is below. If the ftp co-process is still running, how would I end it?
Code:
#! /usr/bin/ksh
HOST=hostname
USER=user1
PASSWD=password
#logdir="/opt/system_logs"
logdir="/export/home/user1"
exec 4>&1
ftp -nv >&4 2>&4 |&
for SERVER in server1 server2 server3
do
cd $logdir/$SERVER
for FILENAME in `find . -type f -name "access_log*" -mtime 0 -print | sed 's/^\.\///'`
do
exec 4>&1
ftp -nv >&4 2>&4 |&
print -p open $HOST
print -p user $USER $PASSWD
print -p lcd $logdir/$SERVER
print -p cd $SERVER
print -p bin
print -p put $FILENAME
print -p bye
wait
exit 0
done
done
|
|
#4
|
||||
|
||||
|
try running the script without the red lines ... if that doesn't work still, make sure your find command gives you a definite list and doesn't go into an infinite loop ...
... if you have to kill the process --- look for ftp and/or find as that's where it's most likely to hang ... Quote:
|
|
#5
|
||||
|
||||
|
Also note that "exit 0" causes the script to terminate. Placed inside the loop like that, you will end the script on the first iteration of the loop. Move "exit 0" to the end of the script. On the other hand, leave "wait" exactly where it is. The "wait" makes the script pause until the ftp co-process has exited.
|
||||
| Google The UNIX and Linux Forums |