Download Blender Night Builds automatically - Shell Script

I always want to have the latest version of Blender in my machine so I wrote this script that automates the process of downloading and “installing” Blender Night Builds.

Since I’m a total noob in scripting it may contains mistakes or maybe there are more efficient or flexible ways to do the same thing. So if any of the more experienced guys out there have any suggestions please post a comment.

It’s tested and works OK under Linux Mint 17.1 on a X64 machine.

With a slight modification in paths and in Blender version (if you’re on 32bit) should probably work for you.
I have no idea how this could be achieved under Windows but I think something similar could work for Mac.

You can also add it to you cron jobs (or even anacron) and it will update automatically (though I haven’t found a way for the pop-up message to show)

EDIT! :
IMPORTANT! As “Brian Hanson” mentions below you should first create the directory where Blender should be extracted.
I didn’t originally mention it because i supposed that you already have a directory where you extract all the programs that run locally and don’t need installation.

EDIT!:
If you add the script to your cron jobs and you want a pop up message to inform you that everyting run correctly do it like this:


#Downloads and nightly builds for blender
00 12 * * * env DISPLAY=:0.0 /home/<username>/<path_to_Scripts>/Blender_Night_Build_Downloader

It’s the “env DISPLAY=:0.0” that does the job!

#!/bin/bash 

#a script for automatic download of blender night builds.
#Originally is tested and works under Linux Mint 17.1 X 64
#with slight modifications in can work for your needs

#Goes to the Blender Buildbot and Downloads the proper package
wget -P ~/Downloads/  -r --no-parent -A 'blender*linux-glibc211-x86_64.tar.bz2' https://builder.blender.org/download/

#Extracts the downloaded package in a specified location
tar -xvjf ~/Downloads/builder.blender.org/download/blender-*-x86_64.tar.bz2 --strip 1 -C ~/Programs/Blender/Latest_Build/

#Removes the downloaded files
rm -r  ~/Downloads/builder.blender.org/

#Displays a message
zenity --notification   --timeout=2 --window-icon="info" --text="Latest Blender Build downloaded and installed sucessfully!"

1 Like

This link works fine for those that don´t like tinkering themselves:

https://builder.blender.org/download/

@BrilliantApe. But what you’re proposing it’s what these script is trying to overcome.
Instead of:

  1. Visiting every day this link.
  2. Download the proper package.
  3. Extract it to right place.
  4. Delete downloaded files.

(That’s 4 steps) you can run the script manually and wait a couple of minutes or add it to you cron jobs as i did and it will run automatically.
This way I know that every day at 12:00 the scripts does the job for me and the latest version is in my machine.

The only modification that has to be changed is the extracting path to your prefered one and if you’re on 32-bit the part of the string ‘X86-64’ should be replaced with ‘i686’.

That’s all. To me it sounds easier than repeating 4 steps every time.

Anyway I though it could be useful to other people too.

1 Like

This worked well, but I did find that I had to create the directory for the tar file to be extracted to myself. You might want to consider mentioning that in your original post.

Thanks. I might actually be able to stand using the buildbot builds now.

Christ on a crutch, guy. Blender has run so far past what I can extract from it in any attempt to make art you must be genius of sorts. Or, in the middle of a project just hoping for a new feature. Hell, I’m still trying to wrap my mind around the new grease pencil… And, the possibilities there.

Are you referring to me? I’m always happy to see new features that are cool and useful. I just don’t really like downloading and extracting the buildbot build every time it comes out. I also was building from source for a while, but I always end up with only certain parts of Blender. Not that those parts are always necessary, but they can be nice to have. It’s just to much work to bother working on it.

I found the link needed updating. I also made it download a specific version only. Hardcoded the version to 2.80 for now, but mabey it could be turned into a parameter, and have a default value. Perhaps when left unset, it automatically gets the highest version on the server?

This script also keeps your previous blender version. I did this because 2.80 is currently beta, so new bugs are sometimes introduced.

To anyone who uses this, make sure the link is properly formatted, to get the correct build for your system.

If you just make a new folder and run, blender will be installed in that folder.

#!/usr/bin/env bash

version="2.80" # change for other versions

rm -r previous
mv latest previous
mkdir latest

file="blender-${version}-*-linux-glibc224-x86_64.tar.bz2"
wget -P ./latest -r --no-parent -A "${file}" https://builder.blender.org/download/
tar -xvjf ./latest/builder.blender.org/download/${file} --strip 1 -C ./latest
rm -r ./latest/builder.blender.org
zenity --notification   --timeout=2 --window-icon="info" --text="Latest Blender Build downloaded and installed sucessfully!"
3 Likes