mirror of https://github.com/digint/btrbk
btrbk: add sanity check on timezone offset; add documentation about implications of long-iso time format
parent
c7dd680537
commit
efc260ef91
4
btrbk
4
btrbk
|
@ -3054,7 +3054,9 @@ sub timestamp($$;$)
|
||||||
} else {
|
} else {
|
||||||
my $offset = timegm(@tm) - timelocal(@tm);
|
my $offset = timegm(@tm) - timelocal(@tm);
|
||||||
if($offset < 0) { $ts .= '-'; $offset = -$offset; } else { $ts .= '+'; }
|
if($offset < 0) { $ts .= '-'; $offset = -$offset; } else { $ts .= '+'; }
|
||||||
$ts .= sprintf('%02u%02u', int($offset / (60 * 60)), int($offset / 60) % 60);
|
my $h = int($offset / (60 * 60));
|
||||||
|
die if($h > 24); # sanity check, something went really wrong
|
||||||
|
$ts .= sprintf('%02u%02u', $h, int($offset / 60) % 60);
|
||||||
}
|
}
|
||||||
return $ts;
|
return $ts;
|
||||||
|
|
||||||
|
|
|
@ -75,20 +75,22 @@ space-separated table format.
|
||||||
Timestamp format used as postfix for new snapshot subvolume
|
Timestamp format used as postfix for new snapshot subvolume
|
||||||
names. Defaults to \[lq]short\[rq].
|
names. Defaults to \[lq]short\[rq].
|
||||||
.PP
|
.PP
|
||||||
.IP \fBshort\fR
|
.IP \fBshort\fR 10
|
||||||
YYYYMMDD[_N] (e.g. "20150825", "20150825_1")
|
YYYYMMDD[_N] (e.g. "20150825", "20150825_1")
|
||||||
.IP \fBlong\fR
|
.IP \fBlong\fR 10
|
||||||
YYYYMMDD<T>hhmm[_N] (e.g. "20150825T1531")
|
YYYYMMDD<T>hhmm[_N] (e.g. "20150825T1531")
|
||||||
.IP \fBlong-iso\fR
|
.IP \fBlong-iso\fR 10
|
||||||
YYYYMMDD<T>hhmmss\[t+-]hhmm[_N] (e.g. "20150825T153123+0200")
|
YYYYMMDD<T>hhmmss\[t+-]hhmm[_N] (e.g. "20150825T153123+0200")
|
||||||
.PP
|
.PP
|
||||||
Note that a postfix "_N" is only appended to the timestamp if a
|
Note that a postfix "_N" is appended to the timestamp if a snapshot or
|
||||||
snapshot/backup already exists with the timestamp of current
|
backup already exists with the timestamp of current date/time.
|
||||||
date/time.
|
|
||||||
.PP
|
.PP
|
||||||
Use \[lq]long-iso\[rq] if you want to make sure that btrbk never
|
Use \[lq]long-iso\[rq] if you want to make sure that btrbk never
|
||||||
creates ambiguous time stamps (which can happen if multiple snapshots
|
creates ambiguous time stamps (which can happen if multiple snapshots
|
||||||
are created during a daylight saving time clock change).
|
are created during a daylight saving time clock change).
|
||||||
|
.PP
|
||||||
|
Note that using \[lq]long-iso\[rq] has implications on the scheduling,
|
||||||
|
see RETENTION POLICY (caveats) below.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
\fBsnapshot_dir\fR <directory>
|
\fBsnapshot_dir\fR <directory>
|
||||||
|
@ -289,11 +291,19 @@ running btrbk.
|
||||||
.PP
|
.PP
|
||||||
Caveats:
|
Caveats:
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
|
If you run a setup with several btrbk instances (e.g. one
|
||||||
|
snapshot-only instance per remote client, and a separate fetch-only
|
||||||
|
instance on the backup server), it makes perfectly sense to run btrbk
|
||||||
|
with different local time on the clients, in order to make sure the
|
||||||
|
backups from all the remote hosts are preserved for "midnight", and
|
||||||
|
not at "00:00 UTC" (which would be "14:00" in Honolulu). If you want
|
||||||
|
this behaviour, do NOT use "timestamp_format long-iso".
|
||||||
|
.IP \[bu] 2
|
||||||
If "timestamp_format long-iso" is set, running btrbk from different
|
If "timestamp_format long-iso" is set, running btrbk from different
|
||||||
time zones leads to different interpretation of "first in day, week,
|
time zones leads to different interpretation of "first in day, week,
|
||||||
month, or year". So with this setup, make sure to run btrbk with the
|
month, or year". Make sure to run btrbk with the same time zone on
|
||||||
same time zone on every host (e.g. by setting the TZ environment
|
every host, e.g. by setting the TZ environment variable (see
|
||||||
variable).
|
tzset(3)).
|
||||||
.SH TARGET TYPES
|
.SH TARGET TYPES
|
||||||
.PP
|
.PP
|
||||||
\fBsend-receive\fR
|
\fBsend-receive\fR
|
||||||
|
|
Loading…
Reference in New Issue