Source Code Bundles
B2 C++ Example
PLEASE READ: Backblaze highly recommends you use "b2" command line tool with the "sync" command line option. Click here to get the official b2 command line tool.
B2 C++ Example Source Code kind of like rsync but for B2
b2sync is a multi-threaded command line tool that works on Linux, Windows, and Macintosh. It uploads files to B2 in a fashion inspired by rsync. What that means is that if the lastModified date on a file on your local system has not changed, it won't upload a new copy. It is idempotent, in that you can run it multiple times or restart it in the middle and the results will turn out the same.
b2sync is only available for 64 bit systems. It runs on Windows Vista 64 bit or later, and all Macintosh computers running 10.7 or later, and various Linux distributions like Debian 6 Linux or later, Ubuntu 14 and later, and RedHat 6.7 or later.
Instructions to hand install on Macintosh - open Terminal (command line) and:
Instructions to hand install on Linux - open a shell (command line) and:
Instructions to hand install on 64 bit Windows Vista or later:
Try b2sync -h and also b2sync -longhelp to see (example below is on Windows!):
Tutorial on b2sync b2sync <-FLAGS>
b2sync is in alpha (it is not even beta quality) but we are releasing the source code as a C++ code example to help developers understand how to communicate with B2. This is only an example and not everything will work. Download b2sync C++ src code here.
Compiling the Code
b2sync is written in C++. You will need these tools:
b2sync is ready to compile when you unzip the source code, there should be no configuration required. If you have to change something, please contact Backblaze support and let us know what you had to change!
When successfully compiled, the b2sync binary appears in different locations depending on platform as follows: