Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug-info command #1122

Closed
anarcat opened this issue Jun 3, 2016 · 10 comments
Closed

debug-info command #1122

anarcat opened this issue Jun 3, 2016 · 10 comments

Comments

@anarcat
Copy link
Contributor

anarcat commented Jun 3, 2016

writing up the #1107 bug report, i realized i went through a number of steps that seem intuitive to me, but that are not necessarily obvious to users. furthermore, I had to type down a bunch of commands by hand, which is annoying.

it would be nice if there was a borg-maintained single command that would wrap together a list of properties that are important to submit as part of a bug report. to quote #1107, what I used there is:

root@marcos:~# lsb_release -d
Description:    Debian GNU/Linux 8.4 (jessie)
root@marcos:~# uname -a
Linux marcos 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-1 (2016-03-06) x86_64 GNU/Linux
root@marcos:~# borg --version
borg 1.0.2
root@marcos:~# borg  list /media/sdc2/borg | wc -l 
500
root@marcos:~# time borg info /media/sdc2/borg/::marcos-2016-05-30
Name: marcos-2016-05-30
Fingerprint: dd79e1d17c0d1a3f57f3f7663dae37b0193104a321d37da07f2f5f474f1d2924
Hostname: marcos
Username: root
Time (start): Mon, 2016-05-30 07:38:54
Time (end):   Mon, 2016-05-30 07:52:55
Command line: /usr/bin/borg create --one-file-system --verbose --stats /media/sdc2/borg::marcos-2016-05-30 / /boot /usr /var /home --exclude-caches --exclude /home/*/.cache --exclude */.Trash-* --exclude */[Cc]ache/* --exclude */.bitcoin/blocks/* --exclude *.vmdk --exclude /tmp/* --exclude */build-area/* --exclude /proc/* --exclude /dev/* --exclude /sys/* --exclude /var/cache/* --exclude /var/tmp/* --exclude /var/log/*
Number of files: 1698760

                       Original size      Compressed size    Deduplicated size
This archive:              212.73 GB            187.30 GB            590.28 MB
All archives:              142.37 TB            125.27 TB            671.69 GB

                       Unique chunks         Total chunks
Chunk index:                14719975           2897409051

real    0m57.973s
user    0m20.528s
sys     0m9.272s

or, as a list:

  • lsb_release -b: operating system name, version and codename (Debian GNU/Linux 8.4 (jessie))
  • uname -a: kernel version, architecture and build dates (Linux marcos 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-1 (2016-03-06) x86_64 GNU/Linux)
  • borg --version: self-explanatory
  • borg list /media/sdc2/borg | wc -l: the number of archives in the repository
  • time borg info /media/sdc2/borg/::marcos-2016-05-30: the size of the last archive, with some timing information

I realize that I forgot to mention the python version number, which should include the compiler version. I wonder if we don't want to extract certain parts of the environment as well.

it would also be great if borg info would operate without an archive name, to give information about a whole repository without having to guess the archive name.

@ThomasWaldmann
Copy link
Member

note: some of these infos are already output if an exception happens.

so, the first step would be to maybe add more useful stuff there and then reuse the same code for debug-info command (so one can get it even without an exception happening).

@ThomasWaldmann ThomasWaldmann added this to the 1.0.7 fixes milestone Aug 14, 2016
@ThomasWaldmann ThomasWaldmann self-assigned this Aug 15, 2016
enkore added a commit that referenced this issue Aug 15, 2016
@enkore
Copy link
Contributor

enkore commented Aug 15, 2016

Base implemented in #1481

@anarcat
Copy link
Contributor Author

anarcat commented Aug 16, 2016

yeah, that's a pretty good start.

should we add more stuff in there? in the original post, i suggested two more metrics:

  • borg list /media/sdc2/borg | wc -l: the number of archives in the repository
  • time borg info /media/sdc2/borg/::marcos-2016-05-30: the size of the last archive, with some timing information

maybe it would be tricky to arbitrarily extract that without any context, especially if we're handling a backtrace. maybe an optional argument could be a repository that would give statistics about the repo?

unless there's a good "stats" command already out there - from what I understand, borg info is still limited to operating on archives (and not repositories).

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Aug 18, 2016

Currently, the command is without parameter.
A repo / archive parameter could be optional and add infos about the repo/archive, if given.

As this adds new functionality (while #1481 just calls existing code via another means), I guess we keep just the basic version in 1.0-maint and extend its functionality in 1.1/master.

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1rc1, 1.0.7 fixes Aug 18, 2016
@ThomasWaldmann ThomasWaldmann removed their assignment Aug 20, 2016
@enkore enkore closed this as completed in e50646a Aug 20, 2016
@ThomasWaldmann
Copy link
Member

Maybe we want to extend it a bit for 1.1.

@textshell
Copy link
Member

btw, do we really want this to be in the debug command?

@enkore
Copy link
Contributor

enkore commented Nov 11, 2016

We also have borg-info repo since a while where more user-relevant stuff is found (key type, location, cache location, repo ID, size).

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Nov 11, 2016

current master branch output:

$ borg debug info
Platform: Linux tux 4.7.9-tw2 #5 SMP Fri Oct 21 06:05:38 CEST 2016 x86_64 x86_64
Linux: Ubuntu 16.04 xenial
Borg: 1.1.0b3.dev167+ng01e56a8  Python: CPython 3.5.1+
PID: 10572  CWD: /home/tw/w/borg
sys.argv: ['/home/tw/w/borg-env/bin/borg', 'debug', 'info']
SSH_ORIGINAL_COMMAND: None

CRC implementation: crc32_clmul

$ borg info repoblake2
Enter passphrase for key /home/tw/w/borg/repoblake2: 
Repository ID: 6a1b89a6c5dd475a1c68ac0c7dced0ccaeb0aa8941091ef50917d901f93341a8
Encrypted: Yes (repokey BLAKE2b)
Cache: /home/tw/.cache/borg/6a1b89a6c5dd475a1c68ac0c7dced0ccaeb0aa8941091ef50917d901f93341a8
------------------------------------------------------------------------------
                       Original size      Compressed size    Deduplicated size
All archives:                1.05 GB              1.05 GB              8.39 MB

                       Unique chunks         Total chunks
Chunk index:                       3                  127

(edited by enkore: updated)

@ThomasWaldmann ThomasWaldmann removed this from the 1.1.0rc1 milestone Jul 4, 2017
@ThomasWaldmann
Copy link
Member

removed from milestone, can be done later also.

@ThomasWaldmann
Copy link
Member

Guess we just keep it as is for now.

Adding stuff that can be done by borg info or borg list doesn't look like necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants