Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I accidentally deleted the home directory of user and looks like the user profile or bash profile is deleted. Is there anyway to restore it ? I cannot run bash scripts anymore
Hi all,
I accidentally deleted the home directory of user and looks like the user profile or bash profile is deleted. Is there anyway to restore it ? I cannot run bash scripts anymore
-bash-4.2$
Yes; get it from your backups. If you don't have those, most probably not at this point, since you're still using the system. A .bashrc or .profile isn't difficult to rebuild, and it should definitely not prevent you from running anything. Unless, of course, you had aliases pointing to scripts, and don't have a correct path any longer. What are you typing that won't run any longer?
The creation of the home directory, if it is gone, has to be done by root. Then the permissions have to be set. However the copying of the files has to be done as the account which owns that home directory.
if no backup taken(including trash), we cannot retrieve the deleted items.
Hence create a cron to take a backup by end of each day and move the backup files(tgz/zip) to backup system.
Remove oldest backup files when the backup system having less or no memory.
<<
I have added my comment to help sag2662.
Last edited by murugesandins; 05-01-2024 at 07:30 PM.
if no backup taken(including trash), we cannot retrieve the deleted items.
Hence create a cron to take a backup by end of each day and move the backup files(tgz/zip) to backup system.
Remove oldest backup files when the backup system having less or no memory.
This is what the OP was told before, last year. Is there a reason you're posting to old threads with either duplicate or questionable advice?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.