I have a monitor script that executes every 5 minutes. I am adding functionality that will detect if a previous execution is hung. I have managed to do that by using a flag that is created when the monitor starts and is then removed when the monitor finishes. The hang check simply looks to see if the flag exists and if it does, trigger an alert. Problem is, if a monitor hangs, every subsequent execution shoots off an alert every 5 mins (that's 96 alerts in the morning if it hangs just after I go to bed...)
So, what I need is a second test that will check to see if the flag is older than 1 hour. That way I'll get the initial alert and then one every hour after that instead of every 5 mins. I need a simple condition for my script:
I need something for: [ monitor_running_flag older than 1 hour ]
Hi,
I have the below ".sh" file which I just need to put an IF condition to exit from the file/code. Please see the remarks in the code below:
#!/bin/sh
currentdatehour=`date '+%Y-%m-%d-%H'`
hh=`date '+%H'`
currenthour=`expr ${hh} - 0`
onehourback=`expr ${hh} - 1`
twohoursback=`expr... (2 Replies)
Hi All ,
I want to delete files from /tmp directory created by "xxxx" id.
because i got the list says more than 60 thousand files were created by "xxxx" id since 2002.
The /tmp directory has lot of files created by different user ids like root,system etc..
But, i need a script to... (2 Replies)
I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y"
#!/bin/bash
du -hs $1
while read SIZE ENTRY
do
if ;
then
find $1 -mtime +$2 -exec rm -f {} \;
echo "Files older than $2 days deleted"
else
echo "free Space available"... (4 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi All,
I'm completely new to bash scripting and still learning my way through albeit vey slowly.
I need to know where to insert my server names', my ip address numbers through out the script alas to no avail.
I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
I've found this script part on the stackoverflow:
if ; then
sudo bash "$0" "$@";
exit "$?";
fi
I realized that sudo bash "$0" "$@"; is the only needed for me.
But the strange thing happens when I move this line outside the IF statement:
sudo bash "$0" "$@"; stops the... (9 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
bt-monitor
bt-monitor(1) bluez-tools bt-monitor(1)NAME
bt-monitor - a bluetooth monitor
SYNOPSIS
bt-monitor [OPTION...]
Help Options:
-h, --help
Application Options:
-a, --adapter=<name|mac>
DESCRIPTION
This utility is used to capture DBus signals of bluetoothd. Captured next signals:
Manager signals:
AdapterAdded
AdapterRemoved
DefaultAdapterChanged
Adapter signals:
DeviceCreated
DeviceDisappeared
DeviceFound
DeviceRemoved
AdapterPropertyChanged
Device signals:
DisconnectRequested
DevicePropertyChanged
Services signals:
AudioServiceConnected
InputServiceConnected
NetworkServiceConnected
OPTIONS -h, --help
Show help
-a, --adapter <name|mac>
Specify adapter to capture by his Name or MAC address
(if this option does not defined - all adapters captured)
AUTHOR
Alexander Orlenko <zxteam@gmail.com>.
SEE ALSO bt-adapter(1)bt-agent(1)bt-audio(1)bt-device(1)bt-input(1)bt-network(1)bt-serial(1)
2010-08-16 bt-monitor(1)