![]() (described under -group-separator) between contiguous groups of matches. R, -r, -recursive Recursively search subdirectories listed. Places a line containing a group separator Use of this option forces grep to output lines matching the specified pattern. Places a line containing a group separator (described under -group-separator) Print NUM lines of leading context before matching lines. ![]() Option, this has no effect and a warning is given. Places a line containing a gup separator (described under -group-separator)īetween contiguous groups of matches. Print NUM lines of trailing context after matching lines. How do you grep a file and get the next 5 lines Other than killall -9 oscam1 followed by /usr/local/bin/oscam1 -b -c /usr/local/etc/oscam1 -t /usr/local/tmp.oscam1, in *)is there any better way to killall apart from the original process? So there would be zero downtime? When I run the script, It only kills 2 process's at a time, so I would have to run it 3 times to get it down to 2 process. The command you are trying to execute should be interpreted as 'Starting in the current working directory recurse all directories matching the pattern. usr/local/bin/oscam1 -b -c /usr/local/etc/oscam1 -t /usr/local/tmp.oscam1 Greps -r option (which is the same as the -R, -recursive, -d recurse and -directoriesrecurse options) takes a directory name (or pattern) as its argument. I started 3 extra process's of oscam1 with this line: ![]() While I was testing, I ran into a problem. Recursive grep is a feature in Bash that enables you to search for text within all files in a directory and its subdirectories. Stopping & restarting oscam1: $(date)" > $logfile *) echo "multiple instances of oscam1 running. usr/local/bin/oscam1 -b -c /usr/local/etc/oscam1 -t /usr/local/tmp.oscam1 &Ģ) echo "oscam1 running, all OK: $(date)" > $logfile #! /bin/bashĠ) echo "oscam1 not running, restarting oscam1: $(date)" > $logfile I have adopted your script for my situation Jotne. Linux Script to check if process is running and act on the result
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |