if you have the stat command, this is how you can get the time of last modification of a file:
you can compare this time with current time to determine if the file is 10 days old
Hi all,
I have about 15 directories all with exactly the same structure. I have a file in each of them called log.txt. This file sits in /home/ftp/*usernamehere*/ftptransfer/log/
Username here is the only change in each of the 15 directories.
I want to create a SIMPLE shell script that... (5 Replies)
Hi
I have a requirement to write a script to capture all errors in a Logfile and send the file in email.
If there is any error occurred the subject of email will be ERROR , If there are no error occurred the subject of email will be SUCCESS.
So I created a Log file and put the Appropriate... (2 Replies)
I've been finding myself using a log file colorizer written in perl to reformat and colorize the output from many different programs. Mainly, however, I use it to make the output from "tail -f" commands more readable.
The base perl script I use is based on "colorlogs.pl" available from the... (1 Reply)
AM in need of some plugin/script that can monitor HP-UX file "/var/opt/resmon/log/event.log" .
Have written a scrip in sh shell that is working fine for syslog.log and mail.log as having standard format, have interrogated that to Nagios and is working as I required .
But same script failed to... (3 Replies)
How to check log size every 10min. by script (can use crontab)
if log size not change with alert "Log not update"
Base run on SunOS 5.8 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise
logFiles="log1.log log2.log"
logLocation="/usr/home/test/log/"
Out put.
Tue Jan 31... (3 Replies)
Hi all,
could any provide me a solution for the below requirement.
I have two files namely abc.log.1 and abc.log.2
The above files have time stamp as Dec 08 and Dec 09
I need to rename the files as abc.log.1_20141208 and abc.log.2_20141209 and move to another bkp directory.
Thanks in... (2 Replies)
Hi All..
Is there any easy way to find out how many days older is file?
for ex. fileA 20 days
fileB 10 days
I am currently on AIX, and there is no STAT command available in this environment. What are my options?
Thanks
Abhijeet R (1 Reply)
Apache Web Server:
how to log http 404 error to a separate log file and i do not want to log in access.log
please advice. (2 Replies)
Discussion started by: raghur77
2 Replies
LEARN ABOUT REDHAT
stat
STAT(1) FSF STAT(1)NAME
stat - display file or filesystem status
SYNOPSIS
stat [OPTION] FILE...
DESCRIPTION
Display file or filesystem status.
-f, --filesystem
display filesystem status instead of file status
-c--format=FORMAT use the specified FORMAT instead of the default
-L, --dereference
follow links
-t, --terse
print the information in terse form
--help display this help and exit
--version
output version information and exit
The valid format sequences for files (without --filesystem):
%A - Access rights in human readable form %a - Access rights in octal %b - Number of blocks allocated %D - Device number in hex %d -
Device number in decimal %F - File type %f - raw mode in hex %G - Group name of owner %g - Group ID of owner %h - Number of hard
links %i - Inode number %N - Quoted File name with dereference if symbolic link %n - File name %o - IO block size %s - Total size,
in bytes %T - Minor device type in hex %t - Major device type in hex %U - User name of owner %u - User ID of owner %X - Time of last
access as seconds since Epoch %x - Time of last access %Y - Time of last modification as seconds since Epoch %y - Time of last modi-
fication %Z - Time of last change as seconds since Epoch %z - Time of last change
Valid format sequences for file systems:
%a - Free blocks available to non-superuser %b - Total data blocks in file system %c - Total file nodes in file system %d - Free
file nodes in file system %f - Free blocks in file system %i - File System id in hex %l - Maximum length of filenames %n - File name
%s - Optimal transfer block size %T - Type in human readable form %t - Type in hex
AUTHOR
Written by Michael Meskes.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
SEE ALSO
The full documentation for stat is maintained as a Texinfo manual. If the info and stat programs are properly installed at your site, the
command
info stat
should give you access to the complete manual.
stat (coreutils) 4.5.3 February 2003 STAT(1)