While loop hangs in function running in background
Hello Everyone,
I am writing a shell script to fetch log files from remote servers within a time range. It copies log files to local server, grep for date and then compares the time stamp of each log entry with the once specified.
Below is the code.
I call the above function as shown below
When i run this, the while loop which is reading lines one by one in log file is not terminating once it reaches EOF.
I have tried running it in foreground (removing '&' while calling function) which works perfect.
I want to run it in background because there are 20 servers i need to ssh, scp and read log files which are more than 10 MB each.
Please suggest me if there are any changes needed in this code.
Hello all,
Can someone explain to me the advantage between using subshell over a function call in scripts? To me these are the same. Am I wrong to think this? (4 Replies)
consider the given prg.
main() {
.....
function1(); /* to write into a file or log */
printf(" ");
.....
}
when the control reaches function1(), it should get executed in the
background.At the same time main's printf(" ") statement should also get executed.i.e... (5 Replies)
Dear all,
I'm writing a KornShell script that calls inside it a function in background mode
#!/bin/ksh
function myfunction
{ . . .}
myfunction |&
. . .
How can I capture the PID of the function myfunction that runs in background?
Thanks in advance
:) (2 Replies)
Guys,
can you help me in killing the process which is running in back ground under for loop
I am not able to find the PID using ps -afx|grep <word in command I entered> (1 Reply)
Hi,
I am trying to find files with specific name using find / -name core -print..
this command is hanging and never completes as it is searching for all the automount filesystems ..i cant eliminate using "! -fstype nfs" as this is not a nfs filesystem
pls let me know if anyone know how to... (2 Replies)
This is the gdb backtrace.
^C
Program received signal SIGINT, Interrupt.
0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0 0xffffe424 in __kernel_vsyscall ()
#1 0xb7e56a70 in __nanosleep_nocancel () from /lib/libc.so.6
#2 0xb7e568bb in __sleep (seconds=0) at sleep.c:138
#3 0x080496d5 in... (6 Replies)
Hello, I was trying to make some processes to run at background and went to a problem.
First I tried just to loop in one line something like this:
for i in {1..10}; do echo 'hello world' &; done;
but it pops a syntax error, so I tried several ways to fix it but wasn't able to understand... (2 Replies)
Here is some back ground on the script. The script is to poll an arbitrary number of DB's. To do this I am creating a function that takes the file_path to the DB and the min poll interval as arguments. The function will be called for each DB and then ran in the background. The function I was... (6 Replies)
Discussion started by: ryandavison
6 Replies
LEARN ABOUT LINUX
pure-statsdecode
pure-statsdecode(8) Pure-FTPd pure-statsdecode(8)NAME
pure-statsdecode - Show human-readable dates from a "stats" logfile
SYNTAX
pure-statsdecode filename
pure-statsdecode -
DESCRIPTION
This program decodes Pure-FTPd's "stats" log files and converts timestamps into human-readable dates.
OPTIONS
- means to read the standard input.
filename
is a log file produced with pure-ftpd -O ftpstats:/path/to/logfile
EXAMPLES
To run this program the standard way type:
pure-statsdecode /var/log/pureftpd.log > /tmp/pureftpd.humanlog
Alternativly you can run it as:
cat /var/log/pureftpd.log | pure-statsdecode - | gzip --best > /tmp/pureftpd.humanlog.gz
AUTHORS
Frank DENIS <j at pureftpd dot org>
SEE ALSO ftp(1), pure-ftpd(8)pure-ftpwho(8)pure-mrtginfo(8)pure-uploadscript(8)pure-statsdecode(8)pure-pw(8)pure-quotacheck(8)pure-authd(8)
RFC 959, RFC 2228, RFC 2389 and RFC 2428.
Pure-FTPd team 1.0.36 pure-statsdecode(8)