Hi,
I have written this shell script:
fl=`ls -1lrt $mylist | grep '\.xml$' | awk '{print $9}'`
echo $fl (1)
for i in $fl
do
for dir in $mylist
do
if
then
echo $dir/$i >> tmp (2)
fi
done
done
The mylist contains some directory names. The satement (1) gives the sorted list... (5 Replies)
What is the command to find the path of a file if we know the file name and the root directory where the file resides..
For eg. if a file abc.dat resides in /home/mydir/myfiles/. I am looking for a command which will be fired from / directory, takes abc.dat as input and display the path of... (3 Replies)
Hi all,
Is there any way to find the the path of a file?
I mean executable files and just anyother file we can think of?
i know of one cmd called which
$which mount
/usr/bin/mount
this is fine, but "mount" is a cmd not a file that can be searched
eg: say i have created a text file... (3 Replies)
using OS X and the Terminal, I'd like to find all locked files in a specified directory, unlock them, and print a list of those files that were unlocked
how can I do this?
I'm familiar with chflags nouchg for unlocking one file but not familiar with unix enough to do what I'd like.
Thanks! (0 Replies)
I know this is very newbie ... but I need help determining the proper file path to file...Have no idea how to do this
I'm on a Mac OS X 10.6 Snow Leopard
thanks very much (4 Replies)
Hi Firends,
Good Morning to all,
I want a find command to search a paticular file present in my system(ie search through under all users and all directories.)
I am looking forward from you.:)
Advance Thanks,
Siva Ranganath CH (3 Replies)
Hi i'm new to shell script,
i want to get the filename from specific location which i mentioned in my script.
The scirpt should read the filename exactly using the following command "ls -ltr | tail -1".
Could someone show me on this. Below is my script
#!/bin/ksh
PATH= /usr/
if
then
... (4 Replies)
I need assistance with following requirement, I am new to Unix.
I want to do the following task but stuck with file creation date(sysdate)
Following is the requirement
I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Hi Folks,
I want to run the below command and to exclude the specific path like /var/test/support/... . How to achieve using the below command
find / -type f \( –perm –4000 –o –perm –2000 \) –print
-Siva
Please do not use FONT tags inside CODE tags. And, there is usually no reason to... (2 Replies)
Discussion started by: gsiva
2 Replies
LEARN ABOUT V7
upslog
UPSLOG(8) NUT Manual UPSLOG(8)NAME
upslog - UPS status logger
SYNOPSIS
upslog -h
upslog [OPTIONS]
DESCRIPTION
upslog is a daemon that will poll a UPS at periodic intervals, fetch the variables that interest you, format them, and write them to a
file.
The default format string includes variables that are supported by many common UPS models. See the description below to make your own.
OPTIONS -h
Display the help message.
-f format
Monitor the UPS using this format string. Be sure to enclose format in quotes so your shell doesn't split it up. Valid escapes within
this string are:
%%
Insert a single "%"
%TIME format%
Insert the time with strftime formatting
%ETIME%
Insert the number of seconds, ala time_t. This is now a 10 digit number.
%HOST%
insert the local hostname
%UPSHOST%
insert the host of the UPS being monitored
%PID%
insert the pid of upslog
%VAR varname%
insert the value of variable varname
The default format string is:
%TIME @Y@m@d @H@M@S% %VAR battery.charge% %VAR input.voltage%
%VAR ups.load% [%VAR ups.status%] %VAR ups.temperature%
%VAR input.frequency%
-i interval
Wait this many seconds between polls. This defaults to 30 seconds.
If you require tighter timing, you should write your own logger using the upsclient(3) library.
-l logfile
Store the results in this file.
You can use "-" for stdout, but upslog will remain in the foreground.
-s ups
Monitor this UPS. The format for this option is upsname[@hostname[:port]]. The default hostname is "localhost".
-u username
If started as root, upsmon will setuid(2) to the user id associated with username for security.
If username is not defined, it will use the value that was compiled into the program. This defaults to "nobody", which is less than
ideal.
SERVICE DELAYS
The interval value is merely the number given to sleep(3) after running through the format string. Therefore, a query will actually take
slightly longer than the interval, depending on the speed of your system.
LOG ROTATION
upslog writes its PID to upslog.pid, and will reopen the log file if you send it a SIGHUP. This allows it to keep running when the log is
rotated by an external program.
SEE ALSO
Server:
upsd(8)
Clients:
upsc(8), upscmd(8), upsrw(8), upsmon(8)
Internet resources:
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
Network UPS Tools 05/21/2012 UPSLOG(8)