I copied it into a file I call watch-running-process
Here is a driver script:
The parameters are the PID you are watching, the volume of the source in MB, and an optional delay for the loop (default 5 seconds). Because you supply the PID, you can run anything you want, just as long as it does io that is captured in /proc (so not Solaris, macOS, BSD, etc.). I have not looked in detail at the numbers in /proc, but the script seems to work. If you are interested / curious, see man proc, look at the entry for io, read_bytes, etc.
Here are display snapshots near the beginning, middle, and end of the process for cp as done prior to the call to the monitoring script:
There is not a real progress bar, but it includes an ETA, along with data rates. Given that the numbers are all available in the script, a scaled progress bar probably could be done.
Hello once again:
One thing that seems to be a nice feature is a progress gauge... so I can see how long an operation will take for a task to complete if it is requiring a lot of processing or the file is enormous. I have seen references to gauge operations, but I don't know anything about it or... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
This is a problem I am having with my 2 semester senior project. I have a LAMP server running Ubuntu 9.10 with... (8 Replies)
hey everyone, new here
i have arch setup and i am using smbnetfs to mount some windows shares in /mnt/smbnet
what i want to do is copy files from my home dir to a dir in /mnt/smbnet but i also need it to remove files if i have deleted them from my home dir
seems that cp would be the... (8 Replies)
Hi,
This is my program.
#!/bin/bash
today=`date +"%b-%d-%Y"`
SERVICE="pbxconnect.php"
if ; then
echo "pbx program is running"
else
nohup php pbxconnect.php > logpbx-$today.txt &
fi
On executing using "sh myprogram.sh" , i get the following error.
myprogram.sh: line 4: '
My... (7 Replies)
I'm a bit new to bash programming and I was assigned the job of writing a script that will check to see if a program server is running and to restart the program if it is not up. The script is supposed to check the program every hour (which I have looked up and I believe I know how to do) and send... (3 Replies)
I just can't figure it out , so please just give me a pice of advise how to:
The existing Linux program foo2bar takes as its only argument the name of a single foo file and converts it to an appropriately-named bar file. Provide a script that when executed will run foo2bar against all foo... (4 Replies)
I'm trying to write a script the simplifies the execution of a program:
After starting the program (sh ~/.mfix/model/make_mfix) I am prompted four times for options:
Do you need SMP version? (y/n)
Do you need DMP version? (y/n)
Do you need debug version? (y/n)
Force re-compilation of... (2 Replies)
suppose i have a bash script:
#!/bin/bash
echo "hello"
echo "how are you"
echo "today"
how can i put the entire script above into a basic c program?
i do not want to translate the bash code to a c code. i want C to run the bash code. is this possible?
i found this on the... (15 Replies)
I wish to be able to give to a client the opportunity to :
0) Turn one of my ubuntu computers into a webserver
1) See a webpage after visiting a url where an external user/client can set a couple of variables (e.g. Number1= ?, Number2=?)
2) By pressing "run" the program runs on my machine
3)... (1 Reply)
I am working on a script to get the final total size and so far have the following and wondering if this can be improved.
# Compare the desired size of each lvm to the standard size. If it is desired is larger than calculate the difference and keep that value as the amount to add to that LVM. ... (5 Replies)
Discussion started by: user3528
5 Replies
LEARN ABOUT DEBIAN
ptsematest
ptsematest(8)ptsematest(8)NAME
ptsematest - Start two threads and measure the latency of interprocess communication with POSIX mutex.
SYNTAX
ptsematest [-a|-a PROC] [-b USEC] [-d DIST] [-i INTV] [-l loops] [-p PRIO] [-t|-t NUM]
DESCRIPTION
The program ptsematest starts two threads that are synchronized via pthread_mutex_unlock()/pthread_mutex_lock() and measures the latency
between releasing and getting the lock.
OPTIONS -a, --affinity[=PROC]
Run on procesor number PROC. If PROC is not specified, run on current processor.
-b, --breaktrace=USEC
Send break trace command when latency > USEC. This is a debugging option to control the latency tracer in the realtime preemption
patch. It is useful to track down unexpected large latencies of a system.
-d, --distance=DIST
Set the distance of thread intervals in microseconds (default is 500 us). When cylictest is called with the -t option and more than
one thread is created, then this distance value is added to the interval of the threads: Interval(thread N) = Interval(thread N-1) +
DIST
-i, --interval=INTV
Set the base interval of the thread(s) in microseconds (default is 1000 us). This sets the interval of the first thread. See also
-d.
-l, --loops=LOOPS
Set the number of loops. The default is 0 (endless). This option is useful for automated tests with a given number of test cycles.
ptsematest is stopped once the number of timer intervals has been reached.
-p, --prio=PRIO
Set the priority of the process.
-t, --threads[=NUM]
Set the number of test threads (default is 1, if this option is not given). If NUM is specified, create NUM test threads. If NUM is
not specifed, NUM is set to the number of available CPUs.
EXAMPLES
The following example was running on a 4-way processor:
# ptsematest -a -t -p99 -i100 -d25 -l1000000
#0: ID8672, P99, CPU0, I100; #1: ID8673, P99, CPU0, Cycles 1000000
#2: ID8674, P98, CPU1, I125; #3: ID8675, P98, CPU1, Cycles 811035
#4: ID8676, P97, CPU2, I150; #5: ID8677, P97, CPU2, Cycles 668130
#6: ID8678, P96, CPU3, I175; #7: ID8679, P96, CPU3, Cycles 589423
#1 -> #0, Min 1, Cur 1, Avg 2, Max 11
#3 -> #2, Min 1, Cur 2, Avg 2, Max 13
#5 -> #4, Min 1, Cur 4, Avg 3, Max 12
#7 -> #6, Min 1, Cur 4, Avg 2, Max 12
AUTHORS
Carsten Emde <C.Emde@osadl.org>
SEE ALSO pthread_mutex_lock(3p), pthread_mutex_unlock(3p)
0.1 ptsematest(8)