08-07-2013
thanks. modification time is a good indication of something was updated. but i need to fetch the new entries and process it which stat cannot do.
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
utime(3) Library Functions Manual utime(3)
Name
utime - set file times
Syntax
#include <sys/types.h>
int utime (path, times)
char *path;
struct utimbuf *times;
Description
The path points to a pathname naming a file. The function sets the access and modification times of the named file.
If times is NULL, the access and modification times of the file are set to the current time. A process must be the owner of the file or
have write permission to use in this manner.
If times is not NULL, times is interpreted as a pointer to a utimbuf structure and the access and modification times are set to the values
contained in the designated structure. Only the owner of the file or the super-user can use this way.
The function causes the time of the last file status change(st_ctime) to be updated with the current time.
The times in the following structure are measured in seconds since 00:00:00 GMT, January 1, 1970.
struct utimbuf {
time_t actime; /* access time */
time_t modtime; /* modification time */
};
Return Values
Upon successful completion, a value of zero (0) is returned. Otherwise, a value of -1 is returned, and errno is set to indicate the error.
Diagnostics
The function fails, if any of the following is true:
[EACCES] Search permission is denied by a component of the path prefix.
[EACCES] The effective user ID is not super-user, not the owner of the file, times is NULL, and write access is denied.
[EFAULT] The times is not NULL and points outside the process's allocated address space.
[EFAULT] The path points outside the process's allocated address space.
[ENOENT] The named file does not exist or path points to an empty string and the environment defined is POSIX or SYSTEM_FIVE.
[ENOTDIR] A component of the path prefix is not a directory.
[EPERM] The effective user ID is not a super-user, not the owner of the file, and times is not NULL.
[EROFS] The file system containing the file is mounted read-only.
[ETIMEDOUT] A connect request or remote file operation failed, because the connected party did not respond after a period of time deter-
mined by the communications protocol.
See Also
stat(2)
utime(3)