So, to work out the timestamp to generate the reference file you can use the date command on it's own if your system supports the options like this:-
If your OS does not support those date arguments, then you can play with the TZ variable to acheive the same result, thus:-
Does this suit your needs? Rather than use the TZ variable, you could of course get the values from the date command and build it up yourself, just taking one away from the hours, but then you'd have to handle going back past midnight, so change of day/month/year and it would get messier.
I hope that this helps, but if not, please explain what's wrong and what you need.
Hi,
Out of a list of files in a directory, I want to find the files which were created/modified more than 1 hour ago. I am using HP -UNIX and it does not support the argument -mmin. Please advise.
I am using # !/bin/sh (4 Replies)
Hi Gurus,
I want to find the file created within one hour in solaris.
I have tried below command, but it is no lucky.
$find . -mtime -1/24, -name "abc*"
above command give me the file name which created two hours ago
find . -cmin -60, -name "abc*"
above command I got error as... (4 Replies)
Hi All,
Let me know how can i find and delete files from one unix server to another unix server which are 'N' days older.
Please note that I need to delete files on remote unix server.So, probably i will need to use sftp, but question is how can i identify files and folders which are 'N'... (2 Replies)
Hi,
I need to delete all files, in a folder, older than 2010 that is 2009, 2008 ,.. files...
Can anyone suggest the command for that,...
Thanks
---------- Post updated at 03:29 PM ---------- Previous update was at 02:53 PM ----------
humm,.. ok right now I am using the following:... (4 Replies)
trying to find a way to locate files modified in the last hour in a shell script, unfortunately the command 'find . -mmin -60' is not supported on SunOS 5.10 (works on OpenSolaris 5.11 :mad:)
Does anyone know a method of doing this in shell script on 5.10?
cheers (19 Replies)
I need to write a script to find files older than 2 hours in set of direcotries and list them ina mail. I know find command ti list files greater/lesser than days but i need to do it for hours. Any input. (6 Replies)
Hi,
I have some files in a folder with different time stamps and
I want to display the files which are older than 1 hour.
i tried with find.
need urgent help. (7 Replies)
Hi,
I have some files in a folder with different time stamps and
I want to display the files which are older than 1 hour.
i tried with find.
need urgent help. (3 Replies)
I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in.
How can this be done?? Find returns files that I do not want. (2 Replies)