Commit graph

16 commits

Author SHA1 Message Date
Thomas Waldmann
d2e2f1b89d call socket.gethostname only once 2018-08-04 17:40:40 +02:00
Milkey Mouse
64793d5c15
Use same datetime object for {now} and {utcnow} (fixes #3548)
{now} and {utcnow} should point to the same exact momemt, but they don't
because .now() and .utcnow() create two different objects at different
times. Although the difference will be on the order of microseconds on all
but the slowest machines, this bug still tickles my inner pedant...
2018-03-27 12:55:32 -07:00
Thomas Waldmann
5e4df7782b refactor/move hostname/fqdn related funcs, see #3471
- move stuff to platform.base (should be platform independent according
  to the docs).
- bump platform API version
- parseformat: import fqdn from platform instead of recomputing it

This is not yet fixing #3471, just a preparation for it.
2017-12-24 04:12:02 +01:00
Gregor Kleen
294f06b565 Refactor: call getfqdn() once per call of replace_placeholders() 2017-12-12 12:44:17 +01:00
Gregor Kleen
85fb38e2f3 Add placeholder for fqdn in reverse notation 2017-12-11 23:00:38 +01:00
TW
c5dc75ae23
Merge pull request #3312 from milkey-mouse/borg-config-cmd
Add borg config command
2017-11-24 16:56:15 +01:00
Milkey Mouse
5b47cf6fa5
Add borg config command (fixes #3304)
This command works similarly to "git config" - it parses repo and
cache configs to get, set, and delete values. It only works on local
repos so a malicious client can't e.g. override their storage quota
or reset the append_only flag.

Add tests for borg config

Add documentation for borg config

Change manual config edits -> borg config

There were a couple places in the documentation where it was advised
to edit the repository or cache config file, a process that is stream-
lined by borg config.
2017-11-23 14:51:54 -08:00
Milkey Mouse
d1e327914b Clarify key aliases for borg list --format (#3346)
clarify key aliases for borg list --format, fixes #3111
2017-11-22 17:25:49 +01:00
Thomas Waldmann
5e2de8ba67 implement files cache mode control, fixes #911
You can now control the files cache mode using this option:

--files-cache={ctime,mtime,size,inode,rechunk,disabled}*

(only some combinations are supported)

Previously, only these modes were supported:
- mtime,size,inode (default of borg < 1.1.0rc4)
- mtime,size (by using --ignore-inode)
- disabled (by using --no-files-cache)

Now, you additionally get:
- ctime alternatively to mtime (more safe), e.g.:
  ctime,size,inode (this is the new default of borg >= 1.1.0rc4)
- rechunk (consider all files as changed, rechunk them)

Deprecated:
- --ignore-inodes (use modes without "inode")
- --no-files-cache (use "disabled" mode)

The tests needed some changes:
- previously, we use os.utime() to set a files mtime (atime) to specific
  values, but that does not work for ctime.
- now use time.sleep() to create the "latest file" that usually does
  not end up in the files cache (see FAQ)
2017-10-01 00:52:32 +02:00
Thomas Waldmann
eebb117349 use ISO_FORMAT* constants 2017-09-05 05:02:44 +02:00
Marian Beermann
ab4981eff6 always use microseconds for ISO 8601 output 2017-08-22 17:32:25 +02:00
Marian Beermann
a836f451ab one datetime formatter to rule them all
# Conflicts:
#	src/borg/helpers.py
2017-08-22 17:32:21 +02:00
Thomas Waldmann
6133f1bb60 repo last_modified: use iso8601 timestamp format with --json
like yyyy-mm-ddThh:mm:ss - no tz yet, this likely needs more refactoring
to tz aware and utc datetime objects everywhere, currently there are
naive datetime objects and also localtime at quite some places.
2017-08-07 23:35:10 +02:00
Thomas Waldmann
1df7af58ae archives list: use iso8601 timestamp format with --json
like yyyy-mm-ddThh:mm:ss - no tz yet, this likely needs more refactoring
to tz aware and utc datetime objects everywhere, currently there are
naive datetime objects and also localtime at quite some places.
2017-08-07 23:35:10 +02:00
Thomas Waldmann
09c111bb44 archive listing: use iso8601 timestamp format with --json-lines
like yyyy-mm-ddThh:mm:ss - no tz yet, this likely needs more refactoring
to tz aware and utc datetime objects everywhere, currently there are
naive datetime objects and also localtime at quite some places.
2017-08-07 23:35:10 +02:00
Thomas Waldmann
3e78549f76 helpers: split into smaller modules 2017-08-07 23:05:46 +02:00