10-25-2019
Need help with listing file name and modified date on a huge directory
hi,
We have a huge directory that ha 5.1 Million files in it. We are trying to get the file name and modified timestamp of the most recent 3 years from this huge directory for a migration project.
However, the ls command (background process) to list the file names and timestamp is running for more than 24 hrs and it aborted after sometime.
Is there an efficient way to get the file names and modified timestamp in such huge directory in a relatively quicker time?
Appreciate any options/feedback. Thanks.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to load a group of files and their last dates modified into a text file that will in turn be used with SQL*Loader to load these files into Oracle. I am using a *.ksh script. I am getting the name of the file in by using the following:
for file_ext in 'cat loaddir.ext';
do
find... (2 Replies)
Discussion started by: akpopa
2 Replies
2. UNIX for Advanced & Expert Users
how to directly open a last modified file in a directory? Please help (5 Replies)
Discussion started by: apsprabhu
5 Replies
3. UNIX for Dummies Questions & Answers
I only know how to list all sub-directories or files in specified directory. I don't know how to order them by modified date, furthermore, I don't know how to get the top one file in the sorted list. Wish you can do me a favor. Thanks in advance! (3 Replies)
Discussion started by: crest.boy
3 Replies
4. UNIX for Dummies Questions & Answers
Hi
How to list all the files in a directory that are modified on a particular date?
Also need to know the count,i.e number of files modified on a particular date.
Thanks
Ashok (1 Reply)
Discussion started by: ashok.k
1 Replies
5. UNIX for Advanced & Expert Users
Hi,
I am new bie to Unix. Might be a simple question I am asking.
I want to find the last modified time of a file and find the difference between the currrent time and the last modified time. Appreciate, if someone can throw some light on what commands can be used.
Cheers,
James (2 Replies)
Discussion started by: JamesJoe
2 Replies
6. Shell Programming and Scripting
Hi there
Im trying to find a way to test whether the last modified time is older than 1 day or not
so
#!/bin/bash
if ; then
$TOUCHED = "recently"
else
$TOUCHED = "not so recently"
fi
ive seen loads of posts where people are using find and the -mtime property but i... (2 Replies)
Discussion started by: rethink
2 Replies
7. Shell Programming and Scripting
I wan to pick the latest modified file name and redirect it to a file ..
ls -tr | tail -1 >file
but this is printing file ins side the filename ,
can anyone help me out (5 Replies)
Discussion started by: vishwakar
5 Replies
8. Shell Programming and Scripting
Hi ,
In my directory , i have many days file but i want to see all those which are of todays date.
i tried this but it gives all the files
mtime -0 |ls -ltr
I tried the below option as well.
19635 find -iname "*.LOG" -mtime
19636 ls -ltr *.LOG -mtime -1
19637 ls -ltr *.LOG... (7 Replies)
Discussion started by: guddu_12
7 Replies
9. AIX
I'm using a script that I need to get a file's "last modified date" in a format like 01:51:14 PM. We are running on AIX 6.1.0.0. I can't seem to find the right command parameters. Help! (4 Replies)
Discussion started by: mattadams1983
4 Replies
10. OS X (Apple)
Hi,
Am performing a find based on filename and result can contain multiple files being found
Let's say my find command is
find /Archive -f -name 12345.pdf
and result of find command is
/Archive/Folder A/12345.pdf
/Archive/Folder B/12345.pdf
please note white space in folder names
I... (2 Replies)
Discussion started by: gigagigosu
2 Replies
LEARN ABOUT SUNOS
nis_checkpoint
nis_ping(3NSL) Networking Services Library Functions nis_ping(3NSL)
NAME
nis_ping, nis_checkpoint - NIS+ log administration functions
SYNOPSIS
cc [ flag ... ] file ... -lnsl [ library ... ]
#include <rpcsvc/nis.h>
void nis_ping(nis_name dirname, uint32_t utime, nis_object *dirobj);
nis_result *nis_checkpoint(nis_name dirname);
DESCRIPTION
nis_ping() is called by the master server for a directory when a change has occurred within that directory. The parameter dirname identi-
fies the directory with the change. If the parameter dirobj is NULL, this function looks up the directory object for dirname and uses
the list of replicas it contains. The parameter utime contains the timestamp of the last change made to the directory. This timestamp is
used by the replicas when retrieving updates made to the directory.
The effect of calling nis_ping() is to schedule an update on the replica. A short time after a ping is received, typically about two min-
utes, the replica compares the last update time for its databases to the timestamp sent by the ping. If the ping timestamp is later, the
replica establishes a connection with the master server and request all changes from the log that occurred after the last update that it
had recorded in its local log.
nis_checkpoint() is used to force the service to checkpoint information that has been entered in the log but has not been checkpointed to
disk. When called, this function checkpoints the database for each table in the directory, the database containing the directory and the
transaction log. Care should be used in calling this function since directories that have seen a lot of changes may take several minutes to
checkpoint. During the checkpointing process, the service will be unavailable for updates for all directories that are served by this
machine as master.
nis_checkpoint() returns a pointer to a nis_result structure. See nis_tables(3NSL). This structure should be freed with nis_freeresult().
See nis_names(3NSL). The only items of interest in the returned result are the status value and the statistics.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
nislog(1M), nis_names(3NSL), nis_tables(3NSL), nisfiles(4), attributes(5)
NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are
available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html.
SunOS 5.10 18 Dec 2001 nis_ping(3NSL)