Sponsored Content
Top Forums Shell Programming and Scripting Timestamp comparison of 2 files present in 2 different servers Post 302229429 by goutham4u on Wednesday 27th of August 2008 02:46:34 AM
Old 08-27-2008
Timestamp comparison of 2 files present in 2 different servers

Hi,

I have 2 different log servers and logs are stored in both of them at varied times. Those servers have same files stored at different times. I want to retrieve the latest of the log files that are stored inthe servers. Say "file.log" is present on both servers, i want to check which of it is latest and retrieve it for my analysis.

As of now i have a script to FTP the "file.log" from both the servers and store at one location, but how can i know which of it is latest while the file is present in the server itself.

With my script i am able to FTP the file from both locations and store it at one location in my log server and then i am checking the timestamp by following statement, but it will always give temp_fms02 directory file as latest as it is being FTPied after the first one

if [[ /temp_fms01/icc-2-19-0.log -ot /temp_fms02/icc-2-19-0.log ]]
then
use temp_fms01 file
else
use temp_fms01 file
fi


Pls let me know if there is any other way to check which of the locations is having the latest file and directly FTP it and use it.

Any help or suggesstions are highly appreciated.

Thanks!
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

File timestamp issue on HP servers

Hi All , I have a file which gets updated by a korn job daily . The file gets the latest timestamp on everyrun. But of late i have observed that the file timestamp gets modified to a older date ( Oct 25 2006 ) at some point in time of the day. This change has nothing to do with the job which... (5 Replies)
Discussion started by: siddaonline
5 Replies

2. UNIX for Dummies Questions & Answers

override the system date-timestamp on the Unix servers

I am looking for a tool that allows us to override the system date-timestamp on the Unix servers so that we can perform regression tests using the same set of scripts and data. CDS is an example of a system where the logic is very date/time dependent. It would make regression testing much easier... (5 Replies)
Discussion started by: DavidH
5 Replies

3. Shell Programming and Scripting

Timestamp comparison

Hi all, below is my sample log file 02.20.38 .CASH_I_0069 RPM_RUN_DISTRIBUTION RPM_RUN_DISTRIBUTION 0001 1987 Started at 02.19.11 at node IEREDS17, Pid = 00492972 02.50.39 .CASH_I_0054 RPM_RUN_DISTRIBUTION RPM_RUN_DISTRIBUTION 0001 1987 Completed at 02.49.13, code: 00000000 at node IEREDS17,... (1 Reply)
Discussion started by: zainravi
1 Replies

4. UNIX for Dummies Questions & Answers

Timestamp comparison

How do I compare 2 timestamps (ie... if 2008-02-13 10:48:58.502075 gt 2008-12-15 16:00:00.000000) (4 Replies)
Discussion started by: auzark
4 Replies

5. Shell Programming and Scripting

Comparison of a timestamp and mtime of a file

Hi, I am a beginner in shell scripting. Could any one help me out for below requirement. Its bit urgent. Problem scenario: 1) I have a predefined timestamp (Ex. 2011-03-010 10:10:20) 2) And I have files in a directory starting with 'a' (Ex. a_123.txt, a_124.txt) Expected solution: I... (1 Reply)
Discussion started by: itzsamz
1 Replies

6. Shell Programming and Scripting

Identifying files with a timestamp greater than a given timestamp

I need to be able to identify files with file timestamps greater than a given timestamp. I am using the following solution, although it appears to compare files at the "seconds" granularity and I need it at the milliseconds. When I tested my solution, it missed files that had timestamps... (3 Replies)
Discussion started by: nkm0brm
3 Replies

7. Shell Programming and Scripting

Comparison of timestamp on ftp

Hello Need help with shell script There is are files on my ftp. They overwriting every hour from other places. ls -la /home/ftp/ -rw-r--r-- 1 ftp nogroup 2296 2012-08-11 12:59 G1.zip -rw-r--r-- 1 ftp nogroup 6676 2012-08-11 13:00 KRT1.zip -rw-r--r-- 1 ftp nogroup 5169... (3 Replies)
Discussion started by: ck80
3 Replies

8. Shell Programming and Scripting

File Comparison: Print Lines not present in another file

Hi, I have fileA.txt like this. B01B02 D0011718 B01B03 D0012540 B01B04 D0006145 B01B05 D0004815 B01B06 D0012069 B01B07 D0004064 B01B08 D0011988 B01B09 D0012071 B01B10 D0005596 B01B11 D0011351 B01B12 D0004814 B01C01 D0011804 I want to compare this against another file (fileB.txt)... (3 Replies)
Discussion started by: genehunter
3 Replies

9. Shell Programming and Scripting

Checking in a directory how many files are present and basing on that merge all the files

Hi, My requirement is,there is a directory location like: :camp/current/ In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Discussion started by: srikanth_sagi
10 Replies

10. Shell Programming and Scripting

Unzip all the files with subdirectories present and append a part of string from the main .zip files

Hi frnds, My requirement is I have a zip file with name say eg: test_ABC_UH_ccde2a_awdeaea_20150422.zip within that there are subdirectories on each directory we again have .zip files and in that we have files like mama20150422.gz and so on. Iam in need of a bash script so that it unzips... (0 Replies)
Discussion started by: Ravi Kishore
0 Replies
nisfiles(4)                                                        File Formats                                                        nisfiles(4)

NAME
nisfiles - NIS+ database files and directory structure SYNOPSIS
/var/nis DESCRIPTION
The Network Information Service Plus (NIS+) uses a memory based, replicated database. This database uses a set of files in the /var/nis directory for checkpointing to table storage and for maintaining a transaction log. Additionally, the NIS+ server and client use files in this directory to store binding and state information. The NIS+ service implements an authentication and authorization system that is built upon Secure RPC. In this implementation, the service uses a table named cred.org_dir.domain-name to store the public and private keys of principals that are authorized to access the NIS+ namespace. It stores group access information in the subdomain groups_dir.domain-name as group objects. These two tables appear as files in the /var/nis/data directory on the NIS+ server. Unlike the previous versions of the network information service, in NIS+, the information in the tables is initially loaded into the ser- vice from the ASCII files on the server and then updated using NIS+ utilities. See nistbladm(1). Some sites may wish to periodically regenerate the ASCII files for archival purposes. To do this, a script should be added in the crontab(1) of the server that lists these tables and creates the ASCII file from the result. Note that except for the NIS_COLDSTART and NIS_SHARED_DIRCACHE file, no other files should be manipulated by commands such as cp(1), mv(1) or rm(1). The transaction log file keeps logs of all changes made, and hence the files cannot be manipulated independently. The files described below are stored in the /var/nis directory: NIS_COLDSTART Contains NIS+ directory objects that are to be preloaded into the NIS+ cache at startup time. This file is usually created at NIS+ installation time. See nisinit(1M) or nisclient(1M). NIS_SHARED_DIRCACHE Contains the current cache of NIS+ bindings being maintained by the cache manager. The contents can be viewed with nisshowcache(1M). client_info Contains configuration information, for example, preferred servers, options, and the like, for nis_cachemgr(1M) and potentially other NIS+ clients on the system. It is manipulated by the nisprefadm(1M) command. .pref_servers A cached copy of preferred server information. It is maintained by nis_cachemgr. Do not edit this file manually. trans.log Contains a transaction log that is maintained by the NIS+ service. It can be viewed using the nislog(1M) command. This file contains holes. Its apparent size may be a lot higher than its actual size. There is only one transaction log per server. data.dict A dictionary that is used by the NIS+ database to locate its files. It is created by the default NIS+ database package. data.dict.log The log file for the database dictionary. When the server is checkpointed, this file will be deleted. See the dis- cussion of the -C option of nisping(1M). data Contains databases that the server uses. data/root.object On root servers, this file contains a directory object that describes the root of the name space. data/parent.object On root servers, this file contains a directory object that describes the parent namespace. This file is created by the nisinit(1M) command. data/table_name For each table in the directory there is a file with the same name that stores the information about that table. If there are subdirectories within this directory, the database for the table is stored in the file, table_name.subdi- rectory. data/table_name.log Contains the database log for the table table_name. The log file maintains the state of individual transactions to each database. When a database has been checkpointed, that is, all changes have been made to the data/table_name stable storage, this log file will be deleted. Currently, NIS+ does not automatically do checkpointing. The system administrator may want to do nisping-C opera- tions periodically, perhaps once a day, to checkpoint the log file. This can be done either through a cron(1M) job, or manually. data/root_dir On root servers, this file stores the database associated with the root directory. It is similar to other table databases. The corresponding log file is called root_dir.log. data/cred.org_dir Table containing the credentials of principals in this NIS+ domain. data/groups_dir Table containing the group authorization objects needed by NIS+ to authorize group access. data/serving_list Contains a list of all NIS+ directories that are being served by the NIS+ server on this server. When this server is added or deleted from any NIS+ directory object, this file is updated by the server. SEE ALSO
cp(1), crontab(1), mv(1), nis(1), nis_cachemgr(1M), niscat(1), nismatch(1), nistbladm(1), rm(1), cron(1M), nisclient(1M), nisinit(1M), nis- log(1M), nisping(1M), nisprefadm(1M), nisshowcache(1M), nis_objects(3NSL) 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 nisfiles(4)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy