Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to get ALL update dates and hours of a file? Post 302896960 by zaxxon on Thursday 10th of April 2014 09:15:30 AM
Old 04-10-2014
By default there will be only mtime (modification time) helpful for you. Though there is only the latest time of a modification stored. You can check if there is something like an auditing software for your OS available that might be able to have such a feature to historize file modifications.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Last 24 hours of a log file

I'm looking to pull the last 24 hours of a log file. Here's what I've got so far: yesterday=$(TZ=$TZ+24 date +"%b %e %H:%M") today=$(date +"%b %e %H:%M") echo $yesterday $today grep -E "^$yesterday|^$today" /var/adm/syslog/syslog.log But that pulls everything from $yesterday from... (1 Reply)
Discussion started by: Bert
1 Replies

2. Shell Programming and Scripting

How to calculate specific hours between 2 dates

Hi there, I am trying to find out a way to calculate how many hours are between 2 dates but from a specific time range, actually working hours (Monday to Friday 09:00 - 18:00). What I mean is for example date1 = Monday 21 July 2008 22:00:00 so in python 2008-07-21 22:00:00 date2 = Wednesday... (5 Replies)
Discussion started by: sickboy
5 Replies

3. UNIX for Dummies Questions & Answers

Finding a file created within the last 24 hours

which out of atime, ctime, or mtime are the closest to diplaying only the files created within the last 24 hours. is it even possible to find only the files created in the last 24 hours, because I heard that unix files don't hold the creation time as a property of the file. (3 Replies)
Discussion started by: raidkridley
3 Replies

4. Shell Programming and Scripting

Need script to generate all the dates in DDMMYY format between 2 dates

Hello friends, I am looking for a script or method that can display all the dates between any 2 given dates. Input: Date 1 290109 Date 2 010209 Output: 300109 310109 Please help me. Thanks. :):confused: (2 Replies)
Discussion started by: frozensmilz
2 Replies

5. Shell Programming and Scripting

how to list files between last 6 hours to 3 hours

Hi Frens, I want to list some files from a directory, which contains "DONE" in their name, i am receiving files every minute. In this i want to list all the files which are newer than 6 hours but older than 3 hours, of current time i dont want my list to contain the latest files which are ... (4 Replies)
Discussion started by: Prat007
4 Replies

6. Shell Programming and Scripting

finding the file which is modified within last 2 hours

hi, I want to find a file which is modified within last 2 hours i am using sun-os i tried find . -name <filename> -mmin 120 i found that mmin option is not supported in sun-os is there any other alternative option suggestions welcome thanks in advance (5 Replies)
Discussion started by: trichyselva
5 Replies

7. Shell Programming and Scripting

Take action only if a file is X hours (or seconds) old

shell: #!/bin/ash I searched and found a few relevant posts (here and here - both by porter, on the same day (?)) however both are just a do while loop, I need to check a file date and compare it to the current time. I would like it to say if file 'test' is more than 12 hours old than "right... (3 Replies)
Discussion started by: phdeez
3 Replies

8. UNIX for Dummies Questions & Answers

How to write the dates between 2 dates into a file

Hi All, I am trying to print the dates that falls between 2 date variables into a file. Here is the example. $BUS_DATE =20120616 $SUB_DATE=20120613 Output to file abc.txt should be : 20120613,20120614,120120615,20120616 Can you pls help me accomplish this in LINUX. Thanks... (5 Replies)
Discussion started by: dsfreddie
5 Replies

9. Shell Programming and Scripting

Parsing log file for last 2 hours

I want to parse a log file which i am grepping root user connection but is showing whole day and previous day detail as well. First i want to see last 2 hours log file then after that i want to search particular string. Lets suppose right now its 5:00PM, So i want to see the log of 3:00PM to... (6 Replies)
Discussion started by: learnbash
6 Replies

10. Shell Programming and Scripting

Find hours difference between two dates in given format

I have two dates in below format, how would I find the hours difference between the two dates. Im using AIX and ksh. Current date : Wed May 17 14:34:41 SGT 2017 File date : Thu Apr 27 20:52:41 SGT 2017 (3 Replies)
Discussion started by: simpltyansh
3 Replies
TMPWATCH(8)						   System Administrator's Manual					       TMPWATCH(8)

NAME
tmpwatch - removes files which haven't been accessed for a period of time SYNOPSIS
tmpwatch [-u|-m|-c] [-faqstv] [--verbose] [--force] [--all] [--test] [--fuser ] [--atime|--mtime|--ctime] [--quiet] <hours> <dirs> DESCRIPTION
tmpwatch recursively removes files which haven't been accessed for a given number of hours. Normally, it's used to clean up directories which are used for temporary holding space such as /tmp. When changing directories, tmpwatch is very sensitive to possible race conditions and will exit with an error if one is detected. It does not follow symbolic links in the directories it's cleaning (even if a symbolic link is given as its argument), will not switch filesystems, and only removes empty directories and regular files. By default, tmpwatch dates files by their atime (access time), not their mtime (modification time). If files aren't being removed when ls -l implies they should be, use ls -u to examine their atime to see if that explains the problem. If the --atime, --ctime or --mtime options are used in combination, the decision about deleting a file will be based on the maximum of this times. The hours parameter defines the threshold for removing files. If the file has not been accessed for hours hours, the file is removed. Fol- lowing this, one or more directories may be given for tmpwatch to clean up. OPTIONS
-u, --atime Make the decision about deleting a file based on the file's atime (access time). This is the default. -m, --mtime Make the decision about deleting a file based on the file's mtime (modification time) instead of the atime. -c, --ctime Make the decision about deleting a file based on the file's ctime (inode change time) instead of the atime; for directories, make the decision based on the mtime. -a, --all Remove all file types, not just regular files and directories. -d, --nodirs Do not attempt to remove directories, even if they are empty. -f, --force Remove files even if root doesn't have write access (akin to rm -f). -t, --test Doesn't remove files, but goes through the motions of removing them. This implies -v. -s, --fuser Attempt to use the "fuser" command to see if a file is already open before removing it. Not enabled by default. Does help in some circumstances, but not all. Dependent on fuser being installed in /sbin. -v, --verbose Print a verbose display. Two levels of verboseness are available -- use this option twice to get the most verbose output. SEE ALSO
cron(1), ls(1), rm(1), fuser(1) WARNINGS
GNU-style long options are not supported on HP-UX. AUTHORS
Erik Troan <ewt@redhat.com> Preston Brown <pbrown@redhat.com> Nalin Dahyabhai <nalin@redhat.com> 4th Berkeley Distribution Wed Nov 28 2001 TMPWATCH(8)
All times are GMT -4. The time now is 05:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy