Simply run this script to scan for hardlinks before a backup. It stores the hardlink information in a file which can be included in the backup. When the backup is restored the hardlinks can be run again to recreate the hardlinks from the information stored in the file. Hardlinks can also prune hardlinks prior to a backup to save space on the backup device if required.