cPanel Incremental Backup – Release 64 Feature

     
17th April, 2017 by

Release 64 of cPanel brings with it many new and exciting features which includes an improved incremental backup feature. This post will show you what’s changed and why incremental backups might now be worth looking at as an option.

What’s changed with cPanel Incremental Backups?

Before release 64 the incremental option existed, but unfortunately it only allowed you to restore the most recent backup. Great if you’ve spotted issues straight away, but if you needed the backups from a couple of days/weeks ago, it wasn’t an option. As a result we very rarely recommended incremental as a backup option. Instead favouring the compressed option where we could keep and store many distinct backup sets, each of which could be used as a restore point.

Release 64 now supports many restore points for the incremental backup option. This means, like with the compressed backup option, you can keep many days/weeks/months worth of backups and restore any of them at any time.

What is an incremental backup?

In a nutshell, an incremental backup only backs up the files and folders that have changed since the last backup. The theory being if you already created a backup of a file, and it hasn’t changed, why use backup storage to keep a second, third, forth (you get the idea) copy of the data.

What are the benefits of using the cPanel Incremental backup system?

Two key benefits:

1) Incremental Backups use less storage – If you’re retaining many backup sets then there’s a good chance an incremental backup will save you backup storage space. It’s worth noting in cPanel incremental backups aren’t compressed. Also if all your files update all the time, the incremental backup needs to store all those changed files each time. Of course, it’s rare to have a cPanel account where all the files update daily.

2) Backup Performance – As the unchanged files in a new backup don’t need to be copied to the backup media and they’re not compressed (you can’t compress nothing!) incremental backups use less system resources during the backup process.

Are there any downsides to using cPanel Incremental backups?

Yes, 2 downsides:

1) Incremental Backups doesn’t support additional backup locations. If you’re using an FTP server or any other supported secondary location to store your cPanel Backups, incremental isn’t going to work for you.

2) The backups aren’t compressed. If you’re retaining a very small number of backups then there’s a very good chance incremental backups will use more storage than compressed. The real benefit of incremental only comes if you’re keeping many backups where files that stay the same are only stored once.

How can I see how much space an incremental backup uses?

It can be tricky to know how much space you’re saving with an incremental backup as each backup looks to be full size if you query them individually with du:

[email protected] [/backupdisk]# du -sh 2017-04-23/
33G	2017-04-23/
[email protected] [/backupdisk]# du -sh 2017-04-24/
33G	2017-04-24/

It looks like both backups are using 66G in total. Luckily du has a trick up it’s sleeve, that being it will only count a hardlink (see below) once in each run. So if we combine the du to look at both directories at the same time, we see a different result:

[email protected] [/backupdisk]# du -shc 2017-04-23/ 2017-04-24/
33G	2017-04-23/
10G	2017-04-24/
43G	total

As you can see, because we’re not keeping two copies of identical files we’re actually only using 43G of disk space for the two backups, not 66G.

How do cPanel Incremental Backups work?

We thought you’d never ask. The cPanel Incremental backup system uses hardlinks to create links to files that haven’t changed. A hardlink creates an additional link to the very same file (actually an inode, which in turn describes the file, but we’re trying to simplify) which in the OS looks the same as the original. They can have seperate names and be in seperate directories but they must be in the same partition on the system. The two ‘links’ are then complete equals in the eyes of the file system, neither being the “primary” or “source” link.

Here’s a little example of how hardlinks behave. Note the number after the permissions in an ls -l and how it increments to show how many links a file has. If you have any questions, please let us know in the comments. Thanks for stopping by.

[email protected] [~/testln]# ls
./  ../
[email protected] [~/testln]# echo 'i am a test file' > test1
[email protected] [~/testln]# ls -l
total 12
drwxr-xr-x  2 root root 4096 Apr 17 15:56 ./
dr-xr-x--- 26 root root 4096 Apr 17 15:56 ../
-rw-r--r--  1 root root   17 Apr 17 15:56 test1
[email protected] [~/testln]# ln test1 test2
[email protected] [~/testln]# ls -l
total 16
drwxr-xr-x  2 root root 4096 Apr 17 15:56 ./
dr-xr-x--- 26 root root 4096 Apr 17 16:01 ../
-rw-r--r--  2 root root   17 Apr 17 15:56 test1
-rw-r--r--  2 root root   17 Apr 17 15:56 test2
[email protected] [~/testln]# cat test1
i am a test file
[email protected] [~/testln]# cat test2
i am a test file
[email protected] [~/testln]# echo 'updating either file updates both of them' > test2
[email protected] [~/testln]# cat test1
updating either file updates both of them
[email protected] [~/testln]# ln test2 test3
[email protected] [~/testln]# echo 'creating a link to test2 is the same as linking to test1' > test3
[email protected] [~/testln]# cat test1
creating a link to test2 is the same as linking to test1
[email protected] [~/testln]# cat test2
creating a link to test2 is the same as linking to test1
[email protected] [~/testln]# cat test3
creating a link to test2 is the same as linking to test1
[email protected] [~/testln]# ls -l
total 20
drwxr-xr-x  2 root root 4096 Apr 17 16:05 ./
dr-xr-x--- 26 root root 4096 Apr 17 16:01 ../
-rw-r--r--  3 root root   57 Apr 17 16:05 test1
-rw-r--r--  3 root root   57 Apr 17 16:05 test2
-rw-r--r--  3 root root   57 Apr 17 16:05 test3
[email protected] [~/testln]# ls -i test1
8006264 test1
[email protected] [~/testln]# ls -i test2
8006264 test2
[email protected] [~/testln]# ls -i test3
8006264 test3
[email protected] [~/testln]# rm test1
rm: remove regular file `test1'? y
[email protected] [~/testln]# rm test2
rm: remove regular file `test2'? y
[email protected] [~/testln]# cat test3
creating a link to test2 is the same as linking to test1
[email protected] [~/testln]# ls -l
total 12
drwxr-xr-x  2 root root 4096 Apr 17 16:06 ./
dr-xr-x--- 26 root root 4096 Apr 17 16:01 ../
-rw-r--r--  1 root root   57 Apr 17 16:05 test3
[email protected] [~/testln]#

Nick Bryant - Founder

Nick is a 15 year veteran of developing and building successful technology services. He, amongst other things, runs customer service, technical strategy and the cake purchasing rosta at ServerMule. He embraces the joy of learning new technology to the extent any family man can find the time to do.

In 2004 he co-founded what became Australia's largest out of home public ISP, that still services multiple ASX 200 companies and government agencies today.

Follow @NickJBryant
Read More from