create: tell that "Calculating size" time and space needs are caused by --progress
It took me several days to figure out that `--progress` was the culprit to Borg being SIGKILL'd by the kernel, because of OOM, and because of I enabled progress option. This elaborates on what's the calculation for.
from https://borgbackup.readthedocs.io/en/stable/usage/general.html#date-and-time
Unless otherwise noted, we display local date and time.
Internally, we store and process date and time as UTC.
OK, that does not directly say something about --timestamp, but as the cli is also part of the user interface (as output is), this might mean that maybe not the test needs fixing, but our processing of that option.
But, the docs also say:
--timestamp TIMESTAMP
manually specify the archive creation date/time (UTC, yyyy-mm-ddThh:mm:ss format).
Alternatively, give a reference file/directory.
So, using UTC there is a documented feature, although it is different from output using localtime.
So, the test fix in this PR is correct according to the docs. \o/
macOS: to cover some rather old and some rather new python
(not 3.8 though, but 3.8.0 is tested on linux).
linux: to test on 3.7 releases also. stop testing 3.6-dev.
The RepositoryCache used `os.statvfs` which is not available on Windows.
`shutil.disk_usage` provides the same information but in a cross platform way.
changes:
- changed --prefix default to None (was: ''), so we can check using
"is not None" to determine when --prefix has been given.
- the previous check for --prefix being used was just for a truthy
value, so using --prefix='' was not really supported, but happened to
behave the same as the default processing anyway.
- argparse python stdlib code seems to have a bug when processing an
option like --prefix='--', args.prefix will be [] in that case (should
be '--'). With previous code this behaved like no prefix given ([] value
is not truthy). Now, as we check for "is not None", it will try to
process that value but blow up with a TypeError as it can't do [] + '*'.
This is a bit unpretty end, but at least borg prune won't delete all
your archives and it will be a reminder that argparse is broken.
- for borg check --repository-only, we also check for --glob-archives
not being used and give the warning otherwise.
we create the hardlink to be able to secure erase the old config file.
if we can't do that because there is just a problem with hardlinks not
working, the old config will be just overwritten normally (not secure
erased). the user will get a warning in that case, but other than that,
the overall borg operation will succeed.
if there is a bigger problem (like a general lack of permissions or a
general issue with the underlying fs), subsequent operations will fail.