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

Showing during the backup the progress in percentage of every single location #377

Open
nicfab opened this issue May 14, 2024 · 5 comments

Comments

@nicfab
Copy link

nicfab commented May 14, 2024

Hi!
I am new to autorestic.
I didn't find any resources related to the subject.
It will be helpful, during the backup, to show the percentage related to the progress status.
Currently, after running the backup of a single location via the command autorestic -v backup -l locationname I see only:

Backing up location "locationname"

Running hooks
> echo "Checks"
> Executing: /opt/homebrew/bin/bash -c echo "Checks"
Checks

Running hooks
> curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Starting backup for location: ${AUTORESTIC_LOCATION}" https://hc-ping.com/<code>/start
> Executing: /opt/homebrew/bin/bash -c curl -m 10 --retry 5 -X POST -H "Content-Type: text/plain" --data "Starting backup for location: ${AUTORESTIC_LOCATION}" https://hc-ping.com/<code>/start
OK
Backend: backendname
> Executing: /opt/homebrew/bin/restic backup --tag locationname --tag ar:location:locationname PATH
no parent snapshot found, will read all files

As you can see, the last two rows show only that the backup started, but I cannot know how many files, the percentage status, etc.

@gimbo
Copy link

gimbo commented Sep 12, 2024

AFAICS, you need to do two things to make autorestic echo restic's progress info:

  1. Pass the --verbose flag to autorestic.

  2. Set the RESTIC_PROGRESS_FPS env var, which tells restic how frequently to show progress information. As described in the restic docs:

    When running from a non-interactive console progress reporting is disabled by default to not fill your logs. For interactive and non-interactive consoles the environment variable RESTIC_PROGRESS_FPS can be used to control the frequency of progress reporting. Use for example 0.016666 to only update the progress once per minute.

    When restic is being run via autorestic, it detects it's in a non-interactive console progress, so it disables progress reporting by default; this env var lets you switch it back on.

So e.g. you could have an .autorestic.yml something like this, to give updates every 10 seconds:

version: 2

global:
  all:
    verbose: true

extras:
  env: &access
    AWS_ACCESS_KEY_ID: XXX
    AWS_SECRET_ACCESS_KEY: XXX
    RESTIC_PROGRESS_FPS: 0.1

locations:

  foo:
    from: /mnt/foo
    to: s3-foo

  bar:
    from: /mnt/bar
    to: s3-bar
 
backends:

  foo:
    type: s3
    path: XXX
    env:
      <<: *access

  bar:
    type: s3
    path: XXX
    env:
      <<: *access

HTH.

@nicfab
Copy link
Author

nicfab commented Sep 12, 2024

Thank you.
I was actually referring to a progress bar, which says the percentage.

@gimbo
Copy link

gimbo commented Sep 13, 2024

OK but you get something like this:

[0:23] 1.07%  149 files 105.819 MiB, total 1200 files 9.619 GiB, 0 errors ETA 35:17

That isn't a progress bar, but it does show a percentage, file count, size, ETA...? 🤷‍♂️

@nicfab
Copy link
Author

nicfab commented Sep 14, 2024

I want to be clear: you know that there are expert, medium, and newbie users. I consider myself an expert user., although I am not a technical.
My comment is only a suggestion to provide users the opportunity (optional) for a more straightforward process view.
During the backup process, with the verbose mode, you see a lot of information scrolling that (probably) makes it difficult for a medium or newbie user to follow.
In the past, I used "resticprofile", which shows a progress bar with the percentage; that way, the user knows the situation and whether it will take a few or a long time.
A simple progress bar with some additional backup and transfer information (e.g., on S3) might be a solution for a simpler view.

@gimbo
Copy link

gimbo commented Sep 14, 2024

Aha. Yes, in that case: agreed, that would be useful.

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

No branches or pull requests

2 participants