9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Christian Grothaus <christian.grothaus@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: [9fans] Re: jet-lagged fossil
Date: Tue, 21 Sep 2004 10:55:01 +0200	[thread overview]
Message-ID: <80633e2d04092101557fd556a2@mail.gmail.com> (raw)
In-Reply-To: <80633e2d0409201234781e65e6@mail.gmail.com>

I should have looked in the archives more thoroughly:
The problem with automatic snapshots has been reported before,
and a possible workaround is setting the timezone to 'GMT 0'.

I found out that it also works in any timezone, when the
real time clock is set to GMT and timesync is run without
the 'L' flag.
(Then, of course, Windows doesn't get the time correctly, but
never mind. I prefer this solution at the moment.)

But I really don't understand at the moment, why it doesn't
work. Here is the beginning of the snapEvent() function
in /sys/src/cmd/fossil/fs.c:

-----------------------------------------------------------
static void
snapEvent(void *v)
{
	Snap *s;
	u32int now, min;
	Tm tm;
	int need;

	s = v;

	now = time(0)/60;
	vtLock(s->lk);

	/*
	 * Snapshots happen every snapMinutes minutes.
	 * If we miss a snapshot (for example, because we
	 * were down), we wait for the next one.
	 */
	if(s->snapMinutes != ~0 && s->snapMinutes != 0
	&& now%s->snapMinutes==0 && now != s->lastSnap){
		if(!fsSnapshot(s->fs, nil, nil, 0))
			fprint(2, "fsSnapshot snap: %R\n");
		s->lastSnap = now;
	}
        .
        .
        .
-----------------------------------------------------------

So the setting of the timezone should have no influence on
periodic non-archival snapshots, since the time is computed
with time()?!

Christian


      parent reply	other threads:[~2004-09-21  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 19:34 [9fans] " Christian Grothaus
2004-09-20 19:39 ` jmk
2004-09-21  8:55 ` Christian Grothaus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80633e2d04092101557fd556a2@mail.gmail.com \
    --to=christian.grothaus@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).