08-07-2013
Well basically you'll have to check the file's contents from time to time but using stat as the starting point would help save your disk from much IO.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I know that Unix is different from windows in that it needs more manual configuring but how do I get Solaris 8 (Intel version) to recognize my floppy drive and cd-rom??
I mean does it automatically detect the drives at startup and I have to mount them or do I have to create the drives somehow and... (1 Reply)
Discussion started by: eloquent99
1 Replies
2. UNIX for Dummies Questions & Answers
Hello all,
first of all, I apologise if I may ask stupid or obvious questions, but I'm new to UNIX and I think I need a little bit of help before I start gearing up :)
Anyway, I have installed a Solaris 8 on a Sun machine, and it has 2 physical disks in it. However, it seems that it is only... (7 Replies)
Discussion started by: dragunu
7 Replies
3. Programming
Hi. You may know how to detect when a interruption succeeded programming in C. Just like receiving a signal without blocking. Knowing when it was a keystroke (IRQ 2), or a mouse movement (12), or a disk access, etc. and getting actually for example the letter typed.
Thanks a lot. (7 Replies)
Discussion started by: Ashrentum
7 Replies
4. Shell Programming and Scripting
Hello,
I'd like to handle incoming (uploaded) files from a shell script, ideally without busy polling / waiting (e.g. running a cron task every 15'). Is there a command that would just sleep until a new entry has been created in a directory, allowing scripts such as the following:
while... (9 Replies)
Discussion started by: baldyeti
9 Replies
5. Shell Programming and Scripting
Hi All ,
I need a script to find errors in a particular and in a particular path
Actually in my logs i`ve so many kinds of errors(i can even say as 100 types also).if i run the script i need to know the error (some errors can aviod )
so finally the script o/p should be a numeric... (3 Replies)
Discussion started by: radha254
3 Replies
6. Shell Programming and Scripting
Hi,
I will name folders this way : DD-MM-YYYY (07-06-2011 for today).
DATE=`date +%d-%m-%Y`
mkdir $DATE
They will contain a backup of the day.
I want, in my backup script, add a command that will automatically delete folders that are a week old (in this case, when performing the backup of... (7 Replies)
Discussion started by: Always
7 Replies
7. Shell Programming and Scripting
How can view log messages between two time frame from /var/log/message or any type of log files.
when logfiles are very big and especially many messages with in few minutes, I would like to display log messages between 5 minute interval.
Could you pls give me the command? (1 Reply)
Discussion started by: johnveslin
1 Replies
8. Fedora
Hello world,
One of the servers, a Fedora one,rebooted today (Luckily, a testbox).
I tried to get the reason the server rebooted. After going through the messages, I think that the log entries just before and after reboot are missing.
Please below: (****** is the server name, for privacy... (0 Replies)
Discussion started by: satish51392111
0 Replies
9. Shell Programming and Scripting
is there a way to efficiently monitor logfiles that do not have a date or time format? i have several logs on several different servers that need to be monitored. but i realized writing a script for this would be very complex and time consuming giving the variety of things i need to check for i.e.... (2 Replies)
Discussion started by: SkySmart
2 Replies
10. Shell Programming and Scripting
Redirecting log files to null writing junk into log files.
i have log files which created from below command
exec <processname> >$logfile
but when it reaches some size i am redirecting to null while process is running like
>$logfile
manually but after that it writes some junk into... (7 Replies)
Discussion started by: greenworld123
7 Replies
rstat(3N) rstat(3N)
NAME
rstat(), havedisk() - get performance data from remote kernel
SYNOPSIS
DESCRIPTION
returns if host has a disk, if it does not, and -1 if this cannot be determined. The host string is either the official name of the host
or an alias for it. See hosts(4) for more information regarding host names.
fills in the statstime structure for host, and returns if it was successful. The relevant structures are:
struct stats { /* RSTATVERS_ORIG */
int cp_time[4]; /* the time spent in each CPU state */
int dk_xfer[4]; /* total number of disk transfers
on each of the disk interfaces */
unsigned v_pgpgin; /* total VM pages paged in */
unsigned v_pgpgout; /* total VM pages paged out */
unsigned v_pswpin; /* total VM pages paged swapped in */
unsigned v_pswpout; /* total VM pages paged swapped out */
unsigned v_intr; /* total interrupts */
int if_ipackets; /* inbound packets on all interfaces */
int if_ierrors; /* inbound errors on all interfaces */
int if_opackets; /* outbound packets on all interfaces */
int if_oerrors; /* outbound errors on all interfaces */
int if_collisions; /* collisions seen on all interfaces */
};
struct statsswtch { /* RSTATVERS_SWTCH */
int cp_time[4]; /* the time spent in each CPU state */
int dk_xfer[4]; /* total number of disk transfers
on each of the disk interfaces */
unsigned v_pgpgin; /* total VM pages paged in */
unsigned v_pgpgout; /* total VM pages paged out */
unsigned v_pswpin; /* total VM pages paged swapped in */
unsigned v_pswpout; /* total VM pages paged swapped out */
unsigned v_intr; /* total interrupts */
int if_ipackets; /* inbound packets on all interfaces */
int if_ierrors; /* inbound errors on all interfaces */
int if_opackets; /* outbound packets on all interfaces */
int if_oerrors; /* outbound errors on all interfaces */
int if_collisions; /* collisions seen on all interfaces */
unsigned v_swtch; /* total context switches */
long avenrun[3]; /* average number of running jobs */
struct timeval boottime; /* time of last boot */
};
struct statstime { /* RSTATVERS_TIME */
int cp_time[4]; /* the time spent in each CPU state */
int dk_xfer[4]; /* total number of disk transfers
on each of the disk interfaces */
unsigned v_pgpgin; /* total VM pages paged in */
unsigned v_pgpgout; /* total VM pages paged out */
unsigned v_pswpin; /* total VM pages paged swapped in */
unsigned v_pswpout; /* total VM pages paged swapped out */
unsigned v_intr; /* total interrupts */
int if_ipackets; /* inbound packets on all interfaces */
int if_ierrors; /* inbound errors on all interfaces */
int if_opackets; /* outbound packets on all interfaces */
int if_oerrors; /* outbound errors on all interfaces */
int if_collisions; /* collisions seen on all interfaces */
unsigned v_swtch; /* total context switches */
long avenrun[3]; /* average number of running jobs */
struct timeval boottime; /* time of last boot */
struct timeval curtime; /* current system time */
};
RPC Info
Program number:
XDR routines:
int xdr_stats(xdrs, stat)
XDR *xdrs;
struct stats *stat;
int xdr_statsswtch(xdrs, stat)
XDR *xdrs;
struct statsswtch *stat;
int xdr_statstime(xdrs, stat)
XDR *xdrs;
struct statstime *stat;
int xdr_timeval(xdrs, tv)
XDR *xdrs;
struct timeval *tv;
Procs:
Takes no arguments, returns long
which is true if remote host has a disk.
Takes no arguments, return struct statsxxx,
depending on version.
Versions:
WARNINGS
User applications that call this routine must be linked with For example,
AUTHOR
was developed by Sun Microsystems, Inc.
SEE ALSO
rup(1), rstatd(1M).
rstat(3N)