uk01

Well-Known Member
Dec 31, 2009
179
18
68
Hi,

We have just switched over to incremental backups using nfs, which the transfer to a remote server.

For the last 8+ years we've downloaded the tars of cancelled or transferred accounts to our office computers for safe keeping or restores in the event they are needed again.
(especially those for websites we develop)

If we want to create a tar of an account on the backup server, can we just select the date/account we want to tar and via the hardlinks it will create a restorable tar file of that account?

Eg if we keep 7 days backups and we select /2017-10-17/username it will create a full tar of how the account was on that day using the hardlinks in the incremental files?

Or if we selected the latest backup it would create a full tar of that.

If this works, it will of course be MUCH slower as backup servers are low spec high storage, but at least we could get a working tar if we needed one for storage or to give to a customer who wants it.

Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,241
363
Hello,

You'd want to first create the archive itself using the "tar" utility. The following StackOverflow explains how this works when using the "tar" utility:

Dereferencing hard links

Thank you.
 

uk01

Well-Known Member
Dec 31, 2009
179
18
68
Hi Michael,

Thanks, I did some tests on an account with no changed files.

First backup
/backups/2017-10-23/accountname
Downloaded the folder via Cyberduck = 902mb

OK - full folder download from first backup

Latest backup
/backups/2017-10-25/accountname
Downloaded the folder via Cyberduck = 902mb

OK - so it downloaded all files via the symlinks


Tar test

First backup
/backups/2017-10-23/accountname
Tar via Cyberduck to accountname.tar.gz = 788mb

OK - full size tar from first backup

Latest backup
/backups/2017-10-25/accountname
Tar via Cyberduck to accountname.tar.gz = 788mb

OK - so it created tar via the symlinks


SSH tar test
tar -zcf accountname.tar.gz /backups/2017-10-23/accounts/whmwork
788mb

tar -zcf accountname.tar.gz /backups/2017-10-25/accounts/whmwork
788mb


So it seems the tar does follow symlinks ok and creates an archive.

You linked me to another article which mentions
-h, --dereference
follow symlinks; archive and dump the files they point to

--hard-dereference
follow hard links; archive and dump the files they refer to

Which of these and where/why do we need to use them?

Thanks