Sponsored Content
Full Discussion: NFS Share Time an Hour Ahead
Special Forums Windows & DOS: Issues & Discussions NFS Share Time an Hour Ahead Post 302940362 by jim mcnamara on Friday 3rd of April 2015 11:03:27 PM
Old 04-04-2015
The only thing that can do that? Environment variable settings. Specifically TZ.

For whatever reason the NFS process has (an example, I do not know for sure)
a TZ variable that ends in -500, a bogus time offset for CST. You can make time display almost anything you want (within 24 hours) by tinking with the TZ variable. At the exact same moment. See below.

POSIX Systems will respond correctly to three formats of the TZ variable, even patently ridiculous values: Have a read here and then work with that. BTW the filetimes themselves are not messed up - they are in epoch seconds, not a format like May 7 1999 3:00pm CST. The files are in no way "broken". It is completely caused by the C runtime library time routines getting a bad TZ value.

The GNU C Library: TZ Variable

Then play with the TZ variable's contents and then run date and you will see what I mean.

Last edited by jim mcnamara; 04-04-2015 at 12:08 AM..
 

10 More Discussions You Might Find Interesting

1. Solaris

NFS share options

Hello, I'm doing a Perl script to parse the dfstab file and find dangerous configurations (rw to everyone, root access, etc). My question is, if I have a share command like this: share -F nfs -o ro=chrome:copper:zinc,root=chrome /usr/man it means that the /usr/man is "rw" to everyone... (6 Replies)
Discussion started by: psimoes79
6 Replies

2. Red Hat

NFS share error

I got a problem while creating files on a NFS mounted share in a RHEL box. That is when I create an empty file, this is what appears on the screen ############################################### E325: ATTENTION Found a swap file by the name ".test.swp" owned by: jsmith dated: Tue... (2 Replies)
Discussion started by: rcmrulzz
2 Replies

3. Shell Programming and Scripting

trim 0 ahead of a time,pls help~

Hi, I am trying to write a ksh to compare the time in a date date Thu Jul 1 09:01:24 PDT 2010 when I try to get hour date | awk '{print $4}' | cut -f1 -d: 08 how I can trim the 0 ahead of 08 to make it 8? please help~ (7 Replies)
Discussion started by: netbanker
7 Replies

4. UNIX for Advanced & Expert Users

du and df do not match on NFS share

Here is the scenario... NFS share that is accessed every few minutes by approx 70 systems (AIX 5.3/6.1). Filesystem space is being eaten up rapidly according to df however du numbers really never change. lsof and fuser cannot see any unlinked files on either the NFS server or remote... (3 Replies)
Discussion started by: masterpengu
3 Replies

5. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

6. Red Hat

NFS share

Hi, I have an NFS server, i want to mount that nfs share which is having around 500GB to my client system. But my client system doesnt have any free space, is it possible to mount that nfs share in my client. Regards, Mastan (1 Reply)
Discussion started by: mastansaheb
1 Replies

7. UNIX for Dummies Questions & Answers

Permissions for NFS share

Hi, I have created a NFS share in Solaris 10 server1 and mounted it on solaris 10 server 2.But I want to change owner of the files from nobody to a particular user in client. Which command should I use. I have tried the following but it doesn't allow to change permissions in the server2 as... (0 Replies)
Discussion started by: Rossdba
0 Replies

8. Red Hat

NFS share and groups

I am having an issue with getting the proper group settings on NFS-shared directories. NFS server, NFServe, nfs-shares hundreds of project directories...running Solaris 10 latest patches/updates. SAS server, SAServe, statistical analysis server running on RedHat 7 with latest kernel/patches/etc.... (14 Replies)
Discussion started by: cjhilinski
14 Replies

9. Shell Programming and Scripting

Mount NFS Share On NFS Client via bash script.

I need a help of good people with effective bash script to mount nfs shared, By the way I did the searches, since i haven't found that someone wrote a script like this in the past, I'm sure it will serve more people. The scenario as follow: An NFS Client with Daily CRON , running bash script... (4 Replies)
Discussion started by: Brian.t
4 Replies

10. IP Networking

Unable to search NFS Share

My customer has created a share on a Windows Server 2012 system and exported it as a NFS share. I can mount the share on a SCO system, but I only have read/write access. So I am unable to list the contents of the share. It is as if the directories had 0666 permissions. My customer says that this... (5 Replies)
Discussion started by: jgt
5 Replies
timezone(3)						     Library Functions Manual						       timezone(3)

NAME
daylight, timezone, tzname, tzset - Sets and accesses time zone conversion information LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <time.h> void tzset(void): extern int daylight; extern long timezone; extern char *tzname[]; STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: tzset(): POSIX.1, XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. DESCRIPTION
The tzset() function uses the value of the environment variable TZ to set time conversion information used by several other functions, including ctime(), ctime_r(), getdate(), getdate_r(), localtime(), localtime_r(), mktime(), strftime(), and strptime(). If the TZ variable is not set, tzset uses implementation-dependent default time zone information. This information is located in the /etc/zoneinfo/localtime file. See the section, Time Zone Handling, for details. The tzset() function sets the external variable tzname as follows: tzname[0] = "std"; tzname[1] = "dst"; where std indicates the standard time zone and dst designates the alternative time zone (such as Daylight Savings Time). (These variables are described below in the section, The TZ Environment Variable.) The tzset() function also sets the external variable daylight to 0 if Daylight Savings Time conversions should never be applied for the time zone in use. Otherwise, daylight is set to a nonzero value. The external variable timezone is set to the difference, in seconds, between Coordinated Universal Time (UTC) and local standard time. For example: TZ timezone EST 5*60*60 GMT 0*60*60 JST -9*60*60 MET -1*60*60 MST 7*60*60 PST 8*60*60 Time Zone Handling The operating system uses a public-domain time zone handling package that puts time zone conversion rules in easily accessible and modifi- able files. These files are in the directory /etc/zoneinfo/sources. The time zone compiler zic(8) converts these files to a special for- mat described in tzfile(4) and places them in the /etc/zoneinfo directory. This format is readable by the C library functions that handle time zone information. The tzset() function uses the tzfile-formatted file linked by /etc/zoneinfo/localtime to set the time zone conversion information. The /etc/zoneinfo/localtime link is set during installation to a file in the /etc/zoneinfo directory. For example, for time zone information consistent with the city of New York on the American continent, /etc/zoneinfo/localtime is linked to /etc/zoneinfo/America/New_York.. If the TZ environment variable is defined, the defined value overrides the time zone information in /etc/zoneinfo/localtime. TZ can be set by a user as a regular environment variable for converting to alternate time zones. See the section, The TZ Environment Variable, for details. Getting Time Zone Information The libc ctime() and localtime() routines return the local time and time zone information. The ctime() routine returns a string that cor- responds to the local time; for example, Tue Oct 27 13:35:29 1992. The localtime() routine returns a pointer to a tm structure (defined in <sys/time.h>) that contains the local time expressed in fields of the tm structure. For time zone information, there are three relevant fields: A flag that is set to 1 if daylight savings time is cur- rently in effect. Otherwise, the flag is set to 0. Seconds east of Greenwich. For example, -18000 means 5 hours west of Greenwich. Abbreviation for the current time zone (for example, EST, PDT, GMT). Setting Time Zone Information The /etc/zoneinfo/localtime link can be changed by the system administrator to any file in the /etc/zoneinfo directory. For example, the following command changes the local time zone to be consistent with the city of New York on the American continent: # ln -sf /etc/zoneinfo/America/New_York /etc/zoneinfo/localtime Subsequent calls to the time zone related functions in libc (ctime() and localtime()) use this link for the default time zone information. If the time zone and daylight savings time information in the /etc/zoneinfo/sources directory is incorrect for your time zone, you can change the information in the source files and then use the zic command to generate a corresponding /etc/zoneinfo file. A user can override the default time zone information by setting the TZ environment variable as described in the section, The TZ Environ- ment Variable. The TZ Environment Variable When TZ appears in the environment and its value is not a null string, the value has one of three formats: : :pathname stdoffset[dst[offset] [,start[/time],end[/time]]] [Tru64 UNIX] If TZ has the single colon format (:), Coordinated Universal Time (UTC) is used. [Tru64 UNIX] If TZ has the colon-pathname format (:pathname), the characters following the colon specify the pathname of a tzfile(4) for- mat file from which to read the time conversion information. A pathname beginning with a slash (/) represents an absolute pathname; other- wise, the pathname is relative to the system time conversion information directory /etc/zoneinfo. If TZ does not begin with a colon (:), the components of the string are as follows: Three or more characters that are the designation for the standard (std) or alternative (dst) time zone (such as Daylight Savings Time). Only std is required. If dst is not supplied, the alternative time does not apply to the locale. Upper- and lower-case letters are explicitly allowed. Any characters, except digits, a leading colon (:), comma (,), minus (-), plus (+), and ASCII NUL, are allowed. Indicates the value to be added to the local time to arrive at GMT. The offset has the form: hh[:mm[:ss]] The minutes (mm) and seconds (ss) are optional. The hour (hh) is required and can be either one or two digits. The offset follow- ing std is required. If no offset follows dst, the alternative time is assumed to be one hour ahead of standard time. One or more digits can be used; the value is always interpreted as a decimal number. The hour value must be between zero and 24. The value for the minutes and seconds, if present, must be between zero and 59. If preceded by a minus sign (-), the time zone is east of the Prime Meridian; otherwise it is west, which can be indicated by a preceding plus sign (+). Indicates when to change to and return from alternative time. The start argument is the date when the change from standard to alternative time occurs; end is the date for changing back. If start and end are not specified, the default is the US Daylight Saving Time start and end dates. The format for start and end must be one of the following: The Julian day n (1 <= n <= 365). Leap days are not counted. That is, in all years, including leap years, February 28 is day 59 and March 1 is day 60. It is impossible to explicitly refer to February 29. The zero- based Julian day (0 <= n <= 365). Leap days are counted making it possible to refer to February 29. The dth day (0 <= d <= 6) of week n of month m of the year (1 <= n <= 5, 1 <= m <= 12). When n is 5, it refers to the last d day of month m which may occur in either the fourth or fifth week. Week 1 is the first week in which the dth day occurs. Day zero is Sunday. Describes the time when, in current time, the change to or return from alternative time occurs. The time parameter has the same format as offset, except that there can be no leading minus (-) or plus (+) sign. If time is not specified, the default is 02:00:00. As an example, the TZ variable value EST5EDT4,M4.1.0,M10.5.0 describes the rule defined in 1987 for the Eastern time zone in the US. EST (Eastern Standard Time) is the designation for standard time, which is 5 hours behind GMT. EDT (Eastern Daylight Time) is the designation for alternative time, which is 4 hours behind GMT. EDT starts on the first Sunday in April and ends on the last Sunday in October. In both cases, since time was not specified, the changes occur at the default time, which is 2:00 A.M. Note that the start and end dates did not need to be specified since they are the defaults. NOTES
[Tru64 UNIX] For users of the SVID2 habitat, TZ is defined by default in the following format: std offset [dst[offset] ] [Tru64 UNIX] For users of the SVID3 habitat, TZ is defined by default in the following format: :pathname See the section, The TZ Environment Variable, for definitions of the parameters used in these formats. RELATED INFORMATION
Functions: ctime(3), ctime_r(3), difftime(3), getdate(3), getdate_r(3), getenv(3), localtime(3), localtime_r(3), mktime(3), strftime(3), strptime(3), time(3) Commands: date(1), zdump(8), zic(8) Files: tzfile(4) Standards: standards(5) delim off timezone(3)
All times are GMT -4. The time now is 10:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy