Running kopia from cron, simple output option?

I’m running a kopia snapshot job from cron on a Linux box a few times a day, which cron sends me a mail with the output of so I can keep an eye on it. However the mail is kind of a mess as it’s a capture of kopia’s output with the spinning progress character | / - etc, all piled up on one line like:

Snapshotting root@spark:/home/virtmail ...
  | 0 hashing, 0 hashed (0 B), 1 cached (217 B), uploaded 0 B, estimating...  / 1 hashing, 16 hashed (4.6 MB), 23601 cached (12.4 GB), uploaded 198 B, estimating...  * 0 hashing, 25 hashed (4.9 MB), 53254 cached (28.3 GB), uploaded 198 B, estimating...

As you can imagine depending on how much work the snapshot does, the number of progress updates can make for a long line (or a giant word-wrapped block as displayed in the email client.)

Is there an argument to make kopia just output one summary line at the end instead of the live progress update? I’m not really seeing anything that jumps out… I did see an old post about --disable-color but that’s not applicable here, using it still does the animated status.

Thanks

To make the output more readable, you can use these options when running your snapshot: --no-progress --log-level=error --file-log-level=error

2 Likes

Ah thanks, --no-progress were the magic words. It’s not in the help! :grin:

Check out GitHub - ekutner/kopia-mon

Check out GitHub - ekutner/kopia-mon

Does it supports OAuth2? Asking due to Google will disable app password on September 30, 2024

Google is not disabling app passwords. You misread it.

From official Google Blog:

If the app you are using does not support OAuth, you will need to switch to an app that offers OAuth or create an app password to access these apps.

1 Like

Tnx for clarification !

I found also this official answer too, that confirms that app password will still works if 2FA activated on a google account

It doesn’t currently support OAuth but since I’m using gmail with this script, if at some point it becomes a requirement and there is no other easy alternative I’ll probably just add support for it.

just curious, what does the output look like now? Can you provide an example? Are you losing any info with --no progress? I ask because everything in your original output was essentially “progress” information. Not a summary of what happened.

Now I get:

Snapshotting root@spark:/home/virtmail ...
Created snapshot with root k1fcf7f056e66b49d1fb39e9fb0566827 and ID 7102eeb27b5074c851b158aff25ff7fe in 8s

which for me is good enough to keep my eye on the fact that it’s running when it should and doing something (I haven’t run into any snapshot errors yet so I don’t know what that looks like.)

I don’t necessarily mind seeing the actual progress, but the formatting is just not ideal… In a terminal it’s a single status line that animates and updates live and looks nice, but when piped into a file/email it’s a concatenated (sometimes giant) block of unformatted text that your eyes just skip over as unreadable, so it’s not useful to me in this particular context.

1 Like

Thanks. Not ideal, but it gets the job done. I’ll be checking out “kopia-mon” at some point as well. Thanks @ekutner for the project.