Hello,
I'm new of this forum and have very very old and rusty memories of shell scripting (my latest script dates back to about 20 years ago !).
My need is following:
I'm testing a software that make a backup, but at now is not implemented the email report (the sw is in beta).
I'm trying to write a script the extract job result and send me an email.
My problem is to check when the job is finished, in order to grep job result and email it. In other words, until the job is running do nothing; when job is ended,
proceed with the script.
Thanks to those who want to help me.
Davide
This is the script:
------------------------------------------------------------------------
------------------------------------------------------------------------
Not everybody (including me) is familiar with that backup tool. Please explain its behaviour: Does it do the backups itself, or does it send some job(s) into background? Does it start independent processes? Does it come back immediately after doing so?
The info "the while cycle is not working" is not necessarily something to work upon. Please supply way more detail: What doesn't work? How does it deviate from the expexted behaviour? Error messages?
Two comments to your above script:
- the -z checks for zero-length-strings; this might be the opposite of what you want?
- the while loop won't ever react on changing conditions unless you modify the conditions (i.e. the pgrep) INSIDE the loop.
I have several line in a text file. for example
I like apple;
I like apple
I like orange;
Output: I like apple
I try to useif grep -q "!\;$"; then (Not work)
Please use CODE tags when displaying sample input, sample output, and code segments (as required by forum rules). (1 Reply)
I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
I am trying to check if files staring with filename but ending with diffent dates e.g. filename.2011-10-25.
The code I am using is below
if
It works find only if one file is present but returns binary operator expected
when there are mulptiple files.
Please help me correcting it. I... (5 Replies)
Hi,
I am trying to write a regular expression in perl to check if the string end's with "numbers-numbers" or "-numbers".
I experimented something like m/\d*-\d*$/ , but this is not solving my problem.
Can anyone help me in writing this expression?
Well spelled titles and proper use of code... (2 Replies)
Hi..
I have this code which tells me that if a process is running or not. Actually someone on this forum help me to do it. :) But now If i want to check if the process is not running for more than 10 minutes. Does anyone know the code or syntax that checks if a process is not running for some... (1 Reply)
Hi,
I am trying to run a simple UNIX command after i successfully executed SFTP command as shown below.
-----------------------------------------
echo 'Step-1'
sftp -vvv -b path
exit
echo 'Step-2'
------------------------------------------
In above script it executes from the 1st... (3 Replies)
Except the command "top" , is there other function / tool is used to check the process status in the system like
1. what process are running ?
2. how the CPU are allocating ?
3. how many swap is using ?
4. "
Thx. (1 Reply)
I want to find the pid ( by ps ) that has already run over 30 seconds , I know ps only show the minute/hour .
eg. the start time of the below process are 15:19 / 15:20 , but I don't know the exact time ( in term of "second" ) it start to run ( I only know the hour and minute ) , if I want to... (2 Replies)
does anyone know an easy way that at the beginning of your script you check to see if that process is already running? I think it would have something to do with ps but I may be making it more complicated than it has to be. If you have a script run say, every half hour, you would want to check and... (13 Replies)