How To Backup Files On Ubuntu

Backup Ubuntu

Backup Ubuntu Files

Hello everyone, how are you all doing today? I hope you are all having a great start to 2016! Wow, what a year 2015 was and lets hope 2016 will be fair and progressive for all of us on this planet.

Today to celebrate the start of a new year, we will feature a quick guide that will teach you how to backup your files on Ubuntu using the terminal and typing some simple commands. This tutorial is perfect for anyone who wants to quickly backup their folders, music and other apps in a .zip/.tar formats in Linux. Let us begin.

Backup Files Commands On Ubuntu

There’s is some tools you can use to backup your entire system or your most important files. tar, gzip, bzip2, dump and rsync are some tools you can use to backup files and folders. automysqlbackup is a tool to backup your MySQL databases.

Example backup

Here’s an example of a folder backup including all the sub-folders and files within.

tar -cvf archive-name.tar dir1 dir2 dir3....

Now, let’s compress it:

gzip -9 archive-name.tar

You can use bzip2 instead. bzip2 has a better compression rate but is a little slower.

To combine both command, you can use the -z option.

Ubuntu Dump Command

dump is written specifically for backups. It backs up the entire file system and allows multiple levels of backups. The corresponding restorecommand allows for restore from a dump backup.

For example, to backup /boot file system:

dump 0zf backup.boot /boot

Ubuntu MySQL Backup Command

There’s an easy command to backup MySQL databases. automysqlbackup can automatically make daily, weekly, and monthly backups of your MySQL database.

Install

sudo aptitude install automysqlbackup

Configure Backup

sudo vi /etc/default/automysqlbackup

All the backup are stored in the /var/lib/automysqlbackup by default. It is recommended to change this folder. To change the default backup folder, edit the file and modify the BACKUPDIR= to the new location.

You can also receive an email if there’s an error while running the backup. To do this, you need to change the MAILADDR= and add your email address.

Backup Ubuntu Home Folder

You can backup your entire home folder using the zip command. If you want to exclude some folder, you need to use the –exclude parameter.

zip -r myzipbackup.zip  * --exclude=access_log --exclude=public_ftp --exclude=tmp

Ubuntu Backup Help & References Links

Quick Links: How To Update Ubuntu | How To Stop A DDOS Attack | Best PDF Editors For MacDownload Ubuntu Server Guide | Top 5 Strategy Games For PC | Best BitTorrent Clients For Ubuntu | Download VLC For Chromebook | Best Video Editing Software On Ubuntu | Top 5 Microsoft Office Alternatives On Ubuntu | Download Free Ubuntu Books | Cute Girl Wallpapers For Ubuntu | Black Wallpapers For Ubuntu

Today’s Popular Linux Article: Download Warsow Game

You may also like...