[mirror-admin] rsync filtering to reduce master mirror load

Ján ONDREJ (SAL) ondrejj at salstar.sk
Fri Apr 10 05:26:22 EDT 2009


On Fri, Apr 10, 2009 at 09:27:13AM +0200, Ján ONDREJ (SAL) wrote:
> > this is indeed an improvement, thanks.  However, the timestamp
> > calculation isn't quite right unless your system clock is UTC. Care
> > to finish that aspect? :-)
> 
> Thank you for confirmation. Can you check, if it's better this way?

After some more investigation I see, that date/stat/... return epoch always
in UTC. For example does not matter, if I run date with/without -u or
with/without TZ=UTC.

So the first algorithm was OK for my system, I use CET/CEST (UTC+1 or 2).

Why? See this:

[mirror at ftp ~]$ date -u
Pi apr 10 09:20:15 UTC 2009

There is 9:20:15 UTC on my system.

[mirror at ftp ~]$ touch /tmp/x
[mirror at ftp ~]$ stat -c %Y /tmp/x
1239355398

It's epoch is 1239355398.
Now some calculations:

[mirror at ftp ~]$ python
Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) 
[GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> # get only time from epoch, last 24 hours
>>> 1239355398 % (24*3600)
33798
>>> # and get only hours in 24 hour format
>>> 33798 / 3600 # divide by one hour
9
>>> 

Result is same as result of my current date in UTC.

			SAL

--


More information about the Mirror-admin mailing list