From d9b40b478fa1e811c7b80eabda6bf7570d7b631b Mon Sep 17 00:00:00 2001 From: Kovas Palunas Date: Wed, 10 Aug 2022 21:24:21 -0700 Subject: [PATCH 1/2] Google Drive export instructions --- README.md | 10 ++++++++++ to-gdrive.bash | 4 ++++ 2 files changed, 14 insertions(+) create mode 100755 to-gdrive.bash diff --git a/README.md b/README.md index aff9c4e..f014dc1 100644 --- a/README.md +++ b/README.md @@ -58,3 +58,13 @@ Ouput is provided either to a file using the -o flag or to stdout. By default, all output is the raw CSV format provided by the API. Some types support a json output that can be enabled via the -f flag. `-f, --format string The output format. (raw | json) (Only available on the servings type.) (default "raw")` + +## Uploading to Google Drive + +1. Download `gdrive` from https://github.com/prasmussen/gdrive/releases. +1. Execute `to-gdrive.bash` once to test, and to provide the `gdrive` with + permissions to your Google Drive. +1. Use `echo "0 20 * * * ~/to-gdrive"| crontab -` to have the script run every + day. + **This overwrites your crontab.** Use `(crontab -l ; echo ""0 20 * * * + ~/to-gdrive")| crontab -` to append instead diff --git a/to-gdrive.bash b/to-gdrive.bash new file mode 100755 index 0000000..1405d93 --- /dev/null +++ b/to-gdrive.bash @@ -0,0 +1,4 @@ +#!/bin/bash + +./cronometer-export -u -p -e -0d -s -100m > cronometer.csv +./gdrive upload -p cronometer.csv From f9975425df5934169c6b15e27079bc9fb3ad5acf Mon Sep 17 00:00:00 2001 From: Kovas Palunas Date: Thu, 11 Aug 2022 16:21:43 +0000 Subject: [PATCH 2/2] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f014dc1..1ddb332 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ By default, all output is the raw CSV format provided by the API. Some types sup ## Uploading to Google Drive 1. Download `gdrive` from https://github.com/prasmussen/gdrive/releases. +1. Make sure the `gdrive` and `cronometer-export` binaries are in the same directory as the `to-gdrive.bash` script. +1. Fill in your information in `to-gdrive.bash`. 1. Execute `to-gdrive.bash` once to test, and to provide the `gdrive` with permissions to your Google Drive. 1. Use `echo "0 20 * * * ~/to-gdrive"| crontab -` to have the script run every