Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Incremental backups and hardlinks question

Discussion in 'Data Protection' started by postcd, Aug 28, 2017.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    689
    Likes Received:
    14
    Trophy Points:
    68
    Hello, i read Backup Configuration - Documentation - cPanel Documentation

    I see that when i compare one identic file from two daily backups directories they use same inode:
    stat faq.php ../../../../../2017-08-24/accounts/cpanelname/homedir/www/faq.php
    File: `faq.php'
    Size: 1843 Blocks: 8 IO Block: 4096 regular file
    Device: 9007h/36871d Inode: 59901396 Links: 8
    Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
    Access: 2017-08-28 08:00:01.338758490 +0000
    Modify: 2012-06-06 08:06:50.000000000 +0000
    Change: 2017-08-28 02:42:48.745287488 +0000
    File: `../../../../../2017-08-24/accounts/cpanelname/homedir/www/faq.php'
    Size: 1843 Blocks: 8 IO Block: 4096 regular file
    Device: 9007h/36871d Inode: 59901396 Links: 8
    Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
    Access: 2017-08-28 08:00:01.338758490 +0000
    Modify: 2012-06-06 08:06:50.000000000 +0000
    Change: 2017-08-28 02:42:48.745287488 +0000

    So when i backup either one using "rsync -av" or "tar -czf", i will have working file thanks to hardlink?

    But what if the destination file (not hardlink) gets deleted, then all rest daily backup directories will not be able to resolve this file as hardlink will point to no file?

    So it means WHM admins should not manually delete any directories in /backup to prevent missing files shared among archives?

    When i rsync to other server, i will need to do 1:1 of a /backup folder, else if i miss some daily backups, it can result that some files will be inaccessible because hardlinks will point to a missing file?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #1 postcd, Aug 28, 2017
    Last edited: Aug 28, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The remote incremental backup process (with rsync) is designed to check if the files associated with the account backup on the cPanel server also exist on the remote backup destination. If the files do not exist on the remote backup destination (or if the files have changed), then it copies the actual files. Otherwise, it makes use of hard links when the files already exist on the remote backup destination. The following document is available if you'd like to read more about how account backup information is stored:

    Metadata for Backups - Version 66 Documentation - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. brt

    brt Well-Known Member

    Joined:
    Jul 9, 2015
    Messages:
    89
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    US
    cPanel Access Level:
    Root Administrator
    This confused me at first too, trying to figure out how incremental backups were working using date-named directories that were eventually deleted.

    A hard link is different than a Windows-type "shortcut". Your first copy of a file is just a file. The second instance of that same identical file also appears as a file -- an identical file -- but the two (or more) are actually one and the same. Either one can be deleted, and the other will remain as a completely normal file.

    Every "copy" of a hardlink/file basically increments a "copy count" on the original/only actual file, and deleting any of the hardlinks/files just decreases that copy count by one until there's only one remaining, at which point another delete removes the file.

    Hopefully that makes more sense.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice