#!/bin/bash
value=$(</var/www/sym_monitor/manthan.txt)
if [ "$value" == "true" ]; then
ps -ef|grep sym |grep -v grep |awk '{ print $2 }'|sudo xargs kill -9;
cd /var/www/symmetric-ds-3.1.6/bin;
sleep 30;
(sudo ./sym --port 8082 --server);
fi
I'm trying to run the above script every 10 mins using cron.
I'm trying to use Here documents to pass several commands to a remote server over SSH. However I'm having problems.
Hi Team,
I am getting the below error when running the script. Please let me know how to solve this error.
Code:
start_WFA.sh[9]: kill: bad argument count
Below is the Script:
Code:
#!/bin/ksh
kill -9 `ps -ef|grep classpath |grep "/apps/ap" |grep -v "Xmx" |grep $LOGNAME |awk '{print $2}'`
Thanks,
Hello,
When i run this command
Code:
find ./ -type f -print | xargs grep -l 'myWord'
it prints the file name where 'myWord' exists and also something like the below which i want to exclude
Code:
grep: can't open Fields
grep: can't open Search
I tried piping and grep -v 'open' but it did not work.
Thanks in advance
jak
How can I kill multiple PID's related to same application/owner with a single command?
find . -name '.htaccess' -print | xargs grep -il 'sound' | xargs -p sh -c ">{}"
Trying to find some .htaccess files on a host that've been compromised, grep them to make sure they are bad .htaccess (not all on server have been ruined) and blank them out.
All is working, except the last part. Tried many variations of echo > etc.
for example I type
ls -altr | grep "23 Dec"
so it will show files for 23 Dec only and I want to use grep for them, like
ls -altr | grep "23 Dec" | xargs grep -l "some_string"
but this doesn't work)
How to do that?
I am new to shell scripting !!!!!!!!!!.ANY HELP WOULD BE APPRECIATE :-
i want to write a script that will check the log for string:
waiting for [10] seconds
for this I am using :-
Code:
tail -10 log.20101004 | tail -1
and grep the "string" but when matching error is coming ,see script below:-
i want to kill that process if matching pattern came,
Code:
LOG_PATH=/temp/circles/ABHI/
Hello All,
I have a problem in counting number of process getting run with my current script name..
Here it is
Code:
ps -ef | grep $0 | grep -v grep
This display just one line with the PID, PPID and other details when i print it in the script.
But when I want to count the numbers in my script , just like below, it comes out as 2...