A simple bash script to fetch a Trello board as JSON and store it automatically with Git as snapshots.
- bash
- wget
- git
- jq
Hey, you never know...
Using su:
# apt-get install wget git-core jq
Using sudo
sudo apt-get install wget git-core jq
You can skip this step if you have already hacked on and contributed to other projects that use git. If not, welcome :)
git config --global user.name "Your name here"
and
git config --global user.email "[email protected]"
Inside trello-snapshot.sh
there are five settings that need to be set, with only two really being required.
Set the Git repository location without a trailing slash
GIT_REPO='/home/username/trello-backup'
Trello URL to download Trello Board JSON. If you are not sure where to find this read this.
TRELLO_URL='https://trello.com/b/unique-id.json'
The default commit message to use
GIT_COMMIT_MESSAGE='Updated Trello Board'
An example would be:
[master 8b1ffb7] Updated Trello Board
1 file changed, 1 insertion(+), 1 deletion(-)
Local file name for storing Trello Board JSON file and to use in git
FILE_NAME='trello-board.json'
Prettify JSON before storing in git. This is useful if you want to see
changes made using git diff HEAD^..HEAD
JQ_PRETTIFY="true" # or false
That's it. Time to backup your Trello board.
./trello-snapshot.sh
You can optionally run this script at a defined time, some examples are
@daily /path/to/trello-snapshot.sh
@hourly /path/to/trello-snapshot.sh 2>&1 /dev/null # No output
# Every day at 4:30 am
30 4 * * * /path/to/trello-snapshot.sh
# Monthly at 4:30 am
30 4 1 * * /path/to/trello-snapshot.sh
Please file any bugs and feature requests here. Pull requests are always welcome.
Made for the South African Ubuntu team (and you of course).