If I used tar to archive Time Machine's Backups.backupdb folder, can the resulting file be uploaded to a cloud service and later used without issues?

If I were to use tar -xvf to create an archived .tar file of the Backups.backupdb folder Time Machine creates, would it sufficiently preserve hard links, etc? For example, if I uploaded to, say Google Drive, and later downloaded it in the future and extracted it to a new drive, would the extracted folder still be readable my Time Machine? Or would the safer route be imaging the entire drive?


Solution 1:

Creating an archive with tar (using the -c option) does by default preserve hard links. I.e. the file will only be stored once in the archive, and when you unpack the archive you'll get hard links on the file system again. It's only when you use the --hard-dereference option to tar that hard links are ignored.

Remember also to use the -p option when creating and restoring the archive. This will preserve the permissions of files, including the ownership, ACL and other information.

Finally I would strongly recommend that you test the backup of the backup after you have made it to ensure that it can be read properly by Time Machine to enable you to restore the actual backup.