rustic icon indicating copy to clipboard operation
rustic copied to clipboard

`rustic snapshots` does not render multi-line descriptions correctly

Open florensie opened this issue 1 year ago • 1 comments

When backing up with --description-from description.txt, where description.txt is a file with multiple lines of text. The output of restic snapshots --long is broken:

C:\Users\Florens\test\stuff>rustic snapshots -r ../repo --long ad78594f682ca4445cb4677dc5891952396db739d04b3f20d770e6ad2faea371
using no config file (.\rustic.toml doesn't exist)
enter repository password:
[INFO] repository local:../repo: password is correct.
[INFO] using cache at C:\Users\Florens\AppData\Local\rustic\dafc41415e5541942621e0127f4fb6d6da8ac43445ef7edaf76054ec63f8b420
| Snapshot      | ad78594f682ca4445cb4677dc5891952396db739d04b3f20d770e6ad2faea371                                                                        |
| Time          | 2023-11-05 11:46:55                                                                                                                     |
| Generated by  | rustic v0.5.4                                                                                                                           |
| Host          | test                                                                                                                                    |
| Label         |                                                                                                                                         |
| Tags          |                                                                                                                                         |
| Delete        | not set                                                                                                                                 |
| Paths         | C:\Users\Florens\test\stuff                                                                                                             |
| Parent        | 6b7f880307692b889be98de56fb007827d12276c66a0ed8cff0f5ba4c07158c4                                                                        |
|               |                                                                                                                                         |
| Command       | C:\Users\Florens\scoop\apps\rustic\current\rustic.exe backup -r ../repo --host test --password  --description-from ../description.txt . |
| Source        | files: 1 / dirs: 6 / size: 6 B                                                                                                          |
|               |                                                                                                                                         |
| Files         | new:          0 / changed:          0 / unchanged:          1                                                                           |
| Dirs          | new:          0 / changed:          0 / unchanged:          6                                                                           |
|               |                                                                                                                                         |
| Added to repo | data:           0 blobs / raw:        0 B / packed:        0 B                                                                          |
|               | tree:           0 blobs / raw:        0 B / packed:        0 B                                                                          |
|               | total:          0 blobs / raw:        0 B / packed:        0 B                                                                          |
| Duration      | backup start: 2023-11-05 11:46:55 / backup end: 2023-11-05 11:46:55 / backup duration: 3ms 160us 600ns                                  |
|               | total duration: 7ms 797us 600ns                                                                                                         |
                                                                                                                                   |
|               | line2                                                                                                                                   |

1 snapshot(s)

The content of description.txt for this test was:

line1
line2

Additionally, it doesn't seem possible to create multi-line descriptions without a description file. I tried doing --description line1\r\nline2, but the escape sequences were included as-is in the output.

florensie avatar Nov 05 '23 10:11 florensie

Thanks a lot for this issue! Seems we need to improve this.

aawsome avatar Nov 05 '23 11:11 aawsome