Using BUP to take backup in ubuntu

bup is a program that backs things up. It’s short for “backup.” BUP is a Very efficient backup system based on the git packfile format, providing fast incremental saves and global deduplication (among and within files, including virtual machine images).

In, simple words, you can use “bup” to take backup of something at one place or one machine and restore it to other place or other machine. Now, to read more about why BUP is great, please visit its github repository at https://github.com/bup/bup

Now, lets try to prepare a demo for how to take a backup and restore in ubuntu 14.04

Install BUP :

We will install it into custom location other than default places in ubuntu, so once you understood, you can always install it to default locations using sudo permissions.

$ mkdir backup
$ cd backup/
$ git clone https://github.com/bup/bup.git
$ cd bup/
$ sudo apt-get build-dep bup
$ make
$ make test
$ mkdir bup-bin
$ make install DESTDIR=$PWD/bup-bin PREFIX=”

This will install the BUP binary into your present working directory, $PWD/bup-bin, you can check using “ls” or “tree” command.

$ tree bup-bin/

Add bup to your path as,

$ export PATH=$PATH:$PWD/bup-bin/bin

Now, you are all set to use bup. Follow below steps to take backup of custom directory and restore it to custom place, instead of standard folders like /etc as mentioned in github documentation.

$ mkdir ~/Desktop/bup-backup-test

$ cd ~/Desktop/bup-backup-test

Now, lets say, we have some source code at /home/myuser/Desktop/mysource which we want to take backup,

$ bup init

$ bup index ~/Desktop/mysource/

$ bup save -n local-source ~/Desktop/mysource/

These steps will take the backup into ~/.bup much similar way of the look of .git folder, when you do “git init”

SHUFFLED :   What is the difference between setup_irq and request_irq in Linux kernel interrupts ?

$ ls -al ~/.bup/

Now your backup is complete, Lets try to restore this to some other directory,

$ mkdir ~/Desktop/bup-restore-test

$ bup restore -C /home/myuser/Desktop/bup-restore-test local-source/latest/home/myuser/Desktop/mysource/

And you should see the contents of your original source at /home/myuser/Desktop/mysource/ restored to /home/myuser/Desktop/bup-restore-test

Remember to use complete path as /home/myuser/Desktop/bup-restore-test with “bup restore” command.

You can check ~/.bup folder using “du -sh” to check how much space has been consumed during backup restore. Do Read github documentation for more understanding. https://github.com/bup/bup

How this will be helpful, Do share this article on facebook, twitter and follow this website.

Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply