How to backup and restore permissions of the entire directory on Linux

The following two commands getfacl and setfacl are very handy tools as they allow Linux administrators to take a snapshot of any current permissions settings of any directory and if needed re-apply those permissions back recursively. Let’s have a look at the following example:

$ tree -p
.
├── [dr---w----]  dir1
│   └── [drwxr-xr-x]  dir2
│       ├── [dr--r-xrw-]  dir3
│       └── [---x--x--x]  file1
├── [drwxr-xr-x]  dir4
│   └── [-rw-r--r--]  file3
└── [-rwxrwxrwx]  file2

4 directories, 3 files

Read more

whereis rsnapshot-diff

Guide to rsnapshot and incremental backups on Linux

Introduction

rsnapshot is a backup tool written in Perl that utilizes rsync as its back-end. rsnapshot allows users to create customized incremental backup solutions. This article will discuss the following: the benefits of an incremental backup solution, rsnapshot’s installation, its configuration, and usage examples.

Back-it up!

I was recently discussing with a colleague the benefits of backing up your data. My colleague was telling me how one of her customers had recently lost a rather lengthy article that they had been working on. I decided that this may be a good chance to experiment with my netbook and rsnapshot. For this tutorial, I’ll assume you have have 2 pieces of hardware: your host computer, and your destination equipment. I’ll be using an external hard drive for the majority of this post. However, I will briefly cover usage for backing up files over a LAN.

Backing up your data should not be the question to ask but rather how should I backup my stuff? What’s the best way? Well there are many different backup pathways you can take, including block level (dd, partimage), partition level (RAID and all its variations), file level (rsyncand its children applications). I’ll discuss two types of backups in the context of file-based backups.

Normal backups, or full backups, are self explanatory. Normal backups are one way of backing up ALL your files every time you perform a backup. One issue with utilizing a multiple normal backup scheme is that a normal backup takes up a considerable amount of space. For example, if you perform a full backup of a 250gig hard drive at 20% capacity, everyday for just one week (assuming that the amount of data does not fluctuate) will mean that you already have used 350gigs for only one week’s worth of backups. As you can see, that is not feasible in the long run. The other method that I prefer is the incremental backup method. An incremental backup consists of one full backup and then performing additional backups. These additional backups will only backup files that have changed since the last backup. Instead of backing up your entire hard drive, only the specific files that have changed since the last backup are backed up. As you can probably imagine this is a much more efficient process. One tool that does this on *nix is rsnapshot.

Read more

How to create incremental backups using rsync on Linux

How to create incremental backups using rsync on Linux

In previous articles, we already talked about how we can perform local and remote backups using rsync and how to setup the rsync daemon. In this tutorial we will learn a very useful technique we can use to perform incremental backups, and schedule them using the good old cron.

In this tutorial you will learn:

  • The difference between hard and symbolic links
  • What is an incremental backup
  • How the rsync –link-dest option works
  • How to create incremental backups using rsync
  • How to schedule backups using cron

Read more

Rsync Examples

Examples on how to use Rsync for local and remote data backups and synchonizations

Rsync is a very useful tool which allows Linux system administrators synchronize data locally or with a remote filesystem via the ssh protocol or by using the rsync daemon. Using rsync is more convenient than simply copying data, because it is able to spot and synchronize only the differences between a source and a destination. The program has options to preserve standard and extended filesystem permissions, compress the data during transfers and more. We will see the most used ones in this guide.

In this tutorial you will learn:

  • How to use rsync to syncronize data
  • How to use rsync with a remote filesystem via ssh
  • How to use rsync with a remote filesystem via the rsync daemon
  • How to exclude files from the synchronization

Read more

How to setup the rsync daemon on Linux

How to setup the rsync daemon on Linux

In a previous article we saw some basic examples of how to use rsync on Linux to transfer data efficiently. As we saw, to synchronize data with a remote machine we can use both a remote shell as  ssh or the rsync daemon. In this article we will focus on the latter option, and we will see how to install and configure rsyncd on some of the most used Linux distributions.

In this tutorial you will learn:

  • How to install and configure the rsync daemon

Read more

How to Create Backups with Fsarchiver on Linux

How to Create Backups with Fsarchiver on Linux

Fsarchiver is a free software utility that let us create file-level backups of one or multiple filesystems in a single archive. One big advantage of this kind of backup is that we can restore it on a filesystem smaller than the original one (but of course large enough to contain all the files); this is usually impossible when performing block-level backups, using tools like partclone or dd. In this article we will learn how to install and use the application and its main features.

Read more