I enjoy using the UI to view the details and progress of my snapshot, as well as viewing the active tasks. I can’t seem to find anywhere where I can parse that through a cli command. Ideas?
Seems like that was also asked a while ago without an answer: Snapshot status - Support - Kopia Forum
kopia snapshot create --no-progress /path/to/subject4backup
It will return something short, like
Connected to repository.
Snapshotting root@mx724:/ ...
Created snapshot with root kXXX and ID xxx in 1h39m32s
Running quick maintenance...
Finished quick maintenance.
on success, or it will include errors, like
Connected to repository.
Snapshotting root@mx724l:/ ...
Error when processing "usr/local/virtual/example.com/user/folder/new/file": no such file or directory
Created snapshot with root kXXX and ID dXXX in 1h15m54s
Running quick maintenance...
Finished quick maintenance.
e[31mERRORe[0m Found 1 fatal error(s) while snapshotting root@mx724:/.
So the gist is undocumented option --no-progress
which trim kopia’s output to parsable status text only
Thank you. Out of curiosity, how did you find out about the undocumented option?
I looked for the solution to reduce amount of useless and huge unparsable email reports to be able to automate alarms on failed backup, searched in source code and google till finally found it.
I called this option as undocumented because it absent in the git repository, but it listed online and present in actual kopia
’s code.
You raise a good point… I’d say this flag is not “undocumented”; rather, it’s “poorly documented.” It is indeed listed in the online site as you pointed out, but it does not show up if you run kopia --help
(which is expected I suppose), but it also does not show up if you run kopia --help-full
.
There’s a related github issue here, which I’ve posted a comment on. Unfortunately the issue has been open since January 2023, so doesn’t appear to have much traction.
Could I pipe this to a text file using linux and execute the command in the background? that way I can track running backups and avoid keeping cli open the whole time. Particularly checking in on long-running commands
If part of documentation is absent (for some very unknown reason, it blocked in .gitignore
) from official kopia's
repository as well from official --help
, --help-full
, --help-long
then it mean undocumented . Also I have no clue why this --no-progress
option is marked as [ADV] that supposed to be use only by advanced users
Could I pipe this to a text file using linux and execute the command in the background?
Yes, sure. Use either nohup kopia...options... >/path/to/log 2>&1
or use some terminal multiplexers, like screen
or tmux
when you run kopia...options... >/path/to/log 2>&1