Backup Abort (4): A hard link was found under Users path

refik4

Verified User
Joined
Sep 22, 2020
Messages
12
The following hard links have been found under User admin:

/home/user/domains/userDomain/public_html/node_modules/@esbuild/linux-x64/bin/esbuild
/home/user/domains/userDomain/public_html/node_modules/esbuild/bin/esbuild


Any solution for this?

Thanks
 
Thanks Richard!


I Add the following line into /usr/local/directadmin/conf/directadmin.conf to disable the check:

backup_hard_link_check=0
But its not so secure.

Any secure method to fix this error?
 
Maybe as temporary fix.
Another way would be maybe to disable or remove the hardlink and make it a softlink. However, on the otherhand that might destroy the user's application so I'm not sure.

Maybe @zEitEr has another idea.
 
if you have linux kernel "fs.protected_hardlinks=1"( enable by default ) and directadmin.conf "strict_backup_permissions=1".

it should secure enought. ( but less than enable hard link check ).
this will secure when other files in your server don't have permission 0777 or group of that user "{test_user}: ..etc.." or "..etc.. :{test_user}

if you don't sure it secure or not, try testing it by yourself.

create test account and hard link something like this.

use test_account run terminal
Code:
ln /etc/shadow /home/{test_account}/test_hardlink
cat /home/{test_account}/test_hardlink
and create some backup then see result.
 
Last edited:
My temporary solution is to delete the node_modules folder while the backup is happening. A simple npm -i will get the folder back with all of its content and is not neccessary for the working of your website. I got this answer from my programmer a couple of months ago and it seems to work like a charm.

I use the following cronjob to delete this folder. It does not delete anything leading up to that folder, it's not like you're going to delete the whole /home folder.

Tested on CentOS7

50 23 * * * find /home/ -maxdepth 5 -not \( -path "*imap*" -o -path "*Maildir*" -o -path "*backups*" -o -path "*tmp*" \) -type d -path "*/public_html/node_modules" -exec rm -rf {} \;

Explanation: find in the /home folder of every user any map that's not related to mail, backups or tmp, only show directories as results which excludes files, and make it required to be in the path of public_html, then delete these specific folders called, as an example, /home/userhere/domains/domainhere.com/public_html/node_modules. Do not look any deeper than 5 layers to make sure the find command doesn't run as long as it needs to. Take away the part -exec rm -rf {} \; if you don't want to delete the folder but only want to show the folders found

Edit: A permanent solution is out of our control. NPM gets a couple of modules online, and you're dependent on the authors of these modules to fix what they need to do, but you still require the modules in order to develop your website, which is why I delete the folder at a time when one is most likely not using it, right before the backup - assuming it's a regularly scheduled backup just after midnight
 
Last edited:
Back
Top