Sponsored Content
Top Forums Shell Programming and Scripting File timestamps in different servers. Post 302173457 by bperl on Thursday 6th of March 2008 05:29:59 PM
Old 03-06-2008
File timestamps in different servers.

Hello,
I need to gather timestamps and file sizes of all the list of files in different servers.
The servers and file locations will be different for each file.
I'm thinking of keeping a comman delimited file with {source_server_name,source location, file name} as records in the file. So, I would cut and get the server, location and file names.

SOURCE_SERVER=`cat $file_list |cut -d"," -f1`
FLOCATION=`cat $file_list |cut -d"," -f2`
FNAME=`cat $file_list |cut -d"," -f3`

Is there any easy way where I can get the file time stamp (modified and/or created) in the source servers?
And how would I connect to different servers (connect and exit out) in the file_list till the timestamp for all the files are captured.

Is telnet better? If telnet is disabled in some servers, can I get timestamp with ssh? I might have to use combination of different connections depending upon which ports are open.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find command not giving file names accord. to timestamps

Currently iam working on solaris environment, Iam using find command to get list of all files between any two given dates. But the find command is not listing files accord. to timestamp. I tried using -exec option as -exec ls -ltr {} \; Still the files are not listed according to timestamp..... (8 Replies)
Discussion started by: thanuman
8 Replies

2. UNIX for Advanced & Expert Users

mv command and file-timestamps

Hi all, I need help to find out if it is possible (if so, how? :D ) to move a hard link to a given file without making the main file i-node modification time change. That is: I have a file myFile.txt , and I have a link myLink.dat to that file (obtained by: ln myFile.txt myLink.dat).... (1 Reply)
Discussion started by: gian1975
1 Replies

3. Shell Programming and Scripting

shell script to search content of file with timestamps in the directory

hello, i want to make a script to search the file contents in my home directory by a given date and output me the line that has the date... (10 Replies)
Discussion started by: psychobeauty
10 Replies

4. Shell Programming and Scripting

timestamps

Hello! I have the following problem. I read a file using perl, each line of this file has the fllowing format. 14/4/2008 8:42:03 πμ|10800|306973223399|4917622951117|1||1259|1|126|492|433||19774859454$ Th first field is the timestamp and the second field is the offset in seconds. How can... (1 Reply)
Discussion started by: chriss_58
1 Replies

5. Shell Programming and Scripting

HOWTO - File Timestamps - how old is a file?

Hi all, Can anyone please advise how to get/display the timestamp of a file and at the same time display how old the file is? For example, if I have a file that is created on January 01, 2011 at 1000 and today is January 03, 2011 2200, I want a script to be able to display the timestamp... (2 Replies)
Discussion started by: newbie_01
2 Replies

6. Shell Programming and Scripting

How to fetch data between two timestamps in a file using KSH

Hi, I got a requirement to fetch data between two time stamps in a big log file and grep for a word in that particular time interval of data. Here is my log looks like: 2012/04/08-14:35:56 Abcdefg 2012/04/08-14:35:56 Hijklmnophhoishfw 2012/04/08-14:35:56... (1 Reply)
Discussion started by: siri_886
1 Replies

7. Shell Programming and Scripting

[Shell/Perl(?)] Prepending timestamps to console output & writing results to a file

I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :] By default, the output of TSM's console has no timestamping, making it hard to sort through accurately. This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies

8. Shell Programming and Scripting

To search lines between two timestamps in a file

I have a log file where every line starts with a time stamp. I have to extract lines from the file within a given time stamp. For example: IF the file is like this: 2012-08-19 10:34:03,446|WebContainer : 56|OrderHeaderDaoImpl|findByKeys|26| 2012-08-20 11:34:03,463|WebContainer :... (8 Replies)
Discussion started by: abhinalluri
8 Replies

9. Shell Programming and Scripting

Search lines between two timestamps in a file

Hi, I want to pull lines between two timestamps from a file. When I just insert values directly it is working fine. sed -n '/2014-02-14 05:30/,/2014-02-14 05:31/p' Logfile When I try to insert variable it is not working. sed -n '/TZ=GMT+1 date +%Y-%m-%d" "%H:%M:%S/,/TZ=GMT date... (2 Replies)
Discussion started by: Neethu
2 Replies

10. Shell Programming and Scripting

Find file between timestamps Query

On my linux box, I have a file say dump.txt. I then need to move to another seperte folder and need to find only one file with extension *.tar that has the closest timestamp after / next to the timestamp of the dump.txt. (2 Replies)
Discussion started by: mohtashims
2 Replies
smtpdcheck(1)							Mail Avenger 0.8.3						     smtpdcheck(1)

NAME
smtpdcheck - check SMTP servers SYNOPSIS
smtpdcheck [--stop {ip-addr|name}] [--timeout seconds] [prio:]server [[prio:]server] DESCRIPTION
smtpdcheck checks to see if SMTP servers are available. The intent is for use on secondary mail servers, which have no reason to accept mail when the primary server is available. The argument consists of a list of server names, each of which may optionally be prefixed by a numeric MX priority and a colon. (This is exactly the format for MX records returned by the avenger dns command.) smtpdcheck will attempt to connect to each server in succession. If one of the servers specified on the command line is available, smtpdcheck will print its name to standard output and exit with status 1. If smtpdcheck cannot connect to any of the servers, it will exit with status 0. If a system error occurs, smtpdcheck will exit with status 2. OPTIONS --stop {ip-addr|name} Tells smtpdcheck to stop before checking a server with IP address ip-addr or hostname name. If such a host is encountered in the list of servers and prio is specified, then smtpdcheck will consider it acceptable for other servers with the same priority to be available, even if those servers were first in the list. In other words, given the following arguments: smtpdcheck --stop s2.domain.com 10:s1.domain.com 10:s2.domain.com 20:s3.domain.com This command will always succeed, regardless of whether "s1.domain.com" is up, because "s2.domain.com" has the same priority. On the other hand, the following command will fail and output "s1.domain.com" if "s1.domain.com" is up: smtpdcheck --stop s2.domain.com 10:s1.domain.com 20:s2.domain.com 30:s3.domain.com If a gethostbyname lookup for the argument name fails, smtpdcheck will exit immediately with status 2. --timeout {seconds] By default, smtpdcheck spends 10 seconds probing each server. This includes the time to do a DNS lookup, to establish a TCP connection to port 25 of the server, and to read the "220" SMTP code from the server's SMTP greeting message. To use a different value, specify it with the --timeout option. The value 0 disables the timeout completely, which is dangerous since smtpdcheck might then end up waiting forever to read the "220" string. EXAMPLES
To refuse to relay mail at a secondary MX server when the primary server is not down, you might place the following in /etc/avenger/secondary (assuming MxLocalRcpt is 1): dns RECIP_MXES mx "$RECIPIENT_HOST" setvars server=`smtpdcheck --stop $MYIP $RECIP_MXES` test -n "$server" && defer "Please use server $server" SEE ALSO
avenger(1) dbutil(1) asmtpd.conf(5), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
smtpdcheck could achieve much lower latency by probing all the servers simultaneously. It should also include some kind of caching, to avoid repeatedly trying to contact an unavailable server. Finally, hosts with multiple IP addresses could be handled more cleanly, though what smtpdcheck does should probably work in most cases. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 smtpdcheck(1)
All times are GMT -4. The time now is 09:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy