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

Log file - add more info about performed operations #1080

Open
kapitainsky opened this issue Feb 24, 2024 · 5 comments
Open

Log file - add more info about performed operations #1080

kapitainsky opened this issue Feb 24, 2024 · 5 comments
Labels
S-triage Status: Waiting for a maintainer to triage this issue/PR

Comments

@kapitainsky
Copy link
Contributor

kapitainsky commented Feb 24, 2024

When running backup, generated log (log-file) contains:

10:24:06 [INFO] using config ./rustic.toml
10:24:07 [INFO] repository opendal:test-dal-lock: password is correct.
10:24:08 [INFO] using cache at /Users/kptsky/Library/Caches/rustic/79622816e3c9c922340f1fd7b7fd31f225f7a1d14faaeea5d6d52386980d16ce
10:24:08 [INFO] using all backup sources from config file.
10:24:08 [INFO] merging source="/private/tmp/rsnap-79622816" section from config file
10:24:09 [INFO] using parent 126c1ce1
10:24:09 [INFO] starting to backup "/private/tmp/rsnap-79622816"...
10:24:10 [INFO] backup of "/private/tmp/rsnap-79622816" done.

When on the console I see:

[00:00:00] reading index...               ████████████████████████████████████████          1/1
[00:00:00] getting latest snapshot...     ████████████████████████████████████████          3/3
[00:00:00] backing up...                  ████████████████████████████████████████ 588.88 MiB/588.88 MiB 859.89 MiB/s (ETA 0s)                                                              Files:       2 new, 5 changed, 239 unchanged
Dirs:        0 new, 6 changed, 20 unchanged
Added to the repo: 345.8 kiB (raw: 3.6 MiB)
processed 246 files, 588.9 MiB
snapshot 96a8a7c1 successfully saved.

It would be great if log file could also contain this information - it is already generated and only not saved in log:

10:24:10 [INFO] Dirs:        0 new, 6 changed, 20 unchanged
10:24:10 [INFO] Added to the repo: 345.8 kiB (raw: 3.6 MiB)
10:24:10 [INFO] processed 246 files, 588.9 MiB
10:24:10 [INFO] snapshot 96a8a7c1 successfully saved.

Similarly for forget and prune etc.

Otherwise without running rustic interactively I do not have really much information about what happened - and it is all what log files are about:)

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Feb 24, 2024
@aawsome
Copy link
Member

aawsome commented Feb 24, 2024

For the backup command: All those information is saved in the snapshots. Try rustic snapshots --long or rustic snapshots --json to get the information.

About forget and prune: Which information do you miss in the logs?

@kapitainsky
Copy link
Contributor Author

kapitainsky commented Feb 24, 2024

For the backup command: All those information is saved in the snapshots. Try rustic snapshots --long or rustic snapshots --json to get the information.

It is nice that it is included in snapshot but I think it is reasonable to expect any logging facility to include it as well? Snapshots also are deleted together with all information. Log file has an obvious purpose - to log:) what happened in the past.

About forget and prune: Which information do you miss in the logs?

What snapshots were deleted, what snapshots were not, reason

What prune did, how much data was repacked, what is unused % after etc.

Pretty much everything what today can only be seen in console and is completely missing from log file.

Today this is what I have in log file when I run forget:

14:04:33 [INFO] using config ./rustic.toml
14:04:34 [INFO] repository opendal:test-dal-lock: password is correct.
14:04:34 [INFO] using cache at /Users/kptsky/Library/Caches/rustic/79622816e3c9c922340f1fd7b7fd31f225f7a1d14faaeea5d6d52386980d16ce

How I can even tell what it was? As for prune I would get:

14:06:21 [INFO] using config ./rustic.toml
14:06:22 [INFO] repository opendal:test-dal-lock: password is correct.
14:06:22 [INFO] using cache at /Users/kptsky/Library/Caches/rustic/79622816e3c9c922340f1fd7b7fd31f225f7a1d14faaeea5d6d52386980d16ce

One more obvious thing would be also to log full rustic command executed + rustic version

When I use log file to look what my rustic backup was doing last month I should be able to see it. So I can investigate what went wrong (or not) and when. Simply by having track record of all actions and their results I can grep for specific date and see all.

And real icing on the cake would be ability to use OS logging subsystem - so for example in Linux to redirect all log to syslog.

All above is of course only wish list but I think it is reasonable long term for rustic to be proper backup solution. Logging similarly to documentation is something many cool software is missing. Here great thing is that we already have all info captured, some presented in console, some saved in snapshots so logging should be low hanging fruit to sort out.

@AlphaJack
Copy link

Is it feasible to add an option to print the file name being processed during backup?

Borg has:

U /path/to/unchanged/file
d /path/to/directory
A /path/to/new-file.txt

@aawsome
Copy link
Member

aawsome commented Mar 7, 2024

@AlphaJack You should be able to see that when using --log-level=debug (or log-level = "debug") in the config profile.

@AlphaJack
Copy link

Thank you, I missed that!

I love your program ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-triage Status: Waiting for a maintainer to triage this issue/PR
Projects
None yet
Development

No branches or pull requests

3 participants