Content of /root folder
I have accidentally copied many things in /root folder now i need to delete them but im not sure about which ones were already there before.
I compared the last edited dates but somehow that doesnt tell me anything because they are all pretty old like at least a month old.
So anyways, the question is;
Do i need any of the files in /root folder? Can i delete them all? or do i have to keep some of them to get my site working properly?
As far as i remember, that folder didnt have more than 1 or 2 files when i first migrated my site to that server. But im not positive. How about in your server? Do you have bunch of stuff in /root folder?
Your /root folder is your home directory for your root user. If you've written stuff to that directory, or if you've put scripts in there while you develop them, then you should perhaps save them out before you delete. But I think the answer you're looking for is that the system itself doesn't put stuff there or keep stuff there for normal operation. While you could lose files which might be valuable to you, the system itself will not care if you delete the contents of the /root directory.
Thank you very much.
Originally Posted by Roxoff
So /root folder is basically the folder which is only for root user himself?
I understand system doesnt care about the content of /root folder but how about like modules, softwares, scripts, webmin, WP, SMF, rsync etc. which you install automatically or through ssh or something?
I wish i can get a backup before deleting them but they are pretty big 100 something GB. So I think i will just take my chance and delete them all.
If you've written scripts yourself that reference files in /root, then keeping those files might be a good idea. If you're ssh-ing around as the root user, I recommend you don't do that any more, delete the root's .ssh directory and do it all as a regular user.
If other software packages are writing settings to /root, it's because you're running as root, and this is not good practice. If you delete files from the /root directory, you may lose settings that have been saved while running packages as the root user.
Ok. Well i deleted everything there and so far its all good. Dont have any problem yet. Thank you very much for your help.
Originally Posted by Website
A good approach for the removal of files that you aren't sure can be deleted is to simply rename them or add an extension to them such as .OLD, then once you are sure no problems exist because of the change you can totally remove the renamed files. Just a safety precaution but it's always worked for me.