Is it possible to accidently delete server files?

by 17 replies
20
This may seem a strange question. But when I am deleting files on my server using FTP is there away to stop accidentally deleting essential files used by the server? rather than just my own website files. Is there some way to tell which are the server files and which are your own? Are these files protected in some way to stop accidental deletion?
#programming #accidently #delete #files #server
  • Always create a backup and when it happens you just need to restore your backup. Accident always there and we can't avoid it unless you didn't touch your server
  • Thanks for reply Ross: I guess it's always risky, but better safe than sorry with a back up.
  • Yeah, like Ross said, keep a backup. And then the obvious answer: be more careful. Happy 2009. - Russ
  • Yes - ensure that the FTP account that you're using only has permission to the web facing directory, or specific directories where your web site resides. At worst, you'll then delete the web site.

    If you're finding that you need server configuration files inside your web site root, then I'd say your host has problems

    And, as previously suggested - always make a backup, and always get your FTP client to prompt for changes, such as deletes, overwrites etc. It's all too easy to go wrong otherwise!
  • Thanks for the useful info n7. There are three files marked with a green cross: "public_html", "www," (the public html and www folders seem to contain the same files) and mail. I assume these files have my web site and email on and I can safely delete stuff without effecting the server files.
    • [2] replies
    • only deal with the public_html folder...don't mess with anything else
    • www is usually an alias (or shortcut) for the public_html folder. When you double click on the www folder, it's actually taking you to the public_html folder.

      I wouldn't go messing around with your mail folder - if you need to delete something on your web site, you can do so within the public_html folder (but I wouldn't recommend deleting the folder itself).
      • [ 1 ] Thanks
  • If you have SSH access, you can even make some files you'd never delete, undeletable.

    chattr +i is the command you'd need. But I suspect you don't have SSH access
  • Thanks for reply improvingtheweb. I going to have word with my web host about this to see if they can do it for me.
  • Actually your FTP will by default point to a users account, in turn it doesnt contain any server info, as long as you are in the /home part your safe
  • If you have an issue with this happening I would suggest you use your cpanel and the file management icon on that page to handle it. Then only click on the file folder next to public_html. If you use an ftp client you should set your ftp client to open the public_html folder by default then you won't be in lower levels where you can cause trouble.

    Martin
  • Thanks for the info guys. I will be sticking to the public_html folder from now on!
  • Make a copy of the public_html folder.

    1. cPanel File Manager Legacy:

    a. Create a new folder titled public_html_ORIGINAL
    Note: Change _ORIGINAL to anything you prefer.

    2. cPanel File Manager Legacy or FTP Program. FTP recommended if you have a lot of folders and files:

    a. Copy all files inside the public_html folder to public_html_ORIGINAL

    Done.

    Now, you have a saved copy of the original public_html folder (public_html_ORIGINAL) and you can change the folder "name.s" in the event you do something wrong.

    Jeffery 100% :-)
  • Thanks for that advice Jeffrey much appreciated. This could save a lot of of future grief and it is relatively simple to do. It is my worst nightmare to delete essential files.
  • Yes, it is possible. However it depends on what rights and access you have to the server. Chances are if you're not a programmer, then it would be really difficult to erase anything other than the files you have uploaded yourself. I.e. you are using a web hosting account as opposed to setting up your own server or, hosting it on Linux and having an Internet connection from your home.

    Most web hosting accounts are pretty much idiot proof, because there are a lot of idiots, and if they didn't do that, then their entire company would be going down probably 10 times or more a day. So don't worry, if you're using a shared web hosting account or something along those lines it's very difficult to crash the system if you don't know what you're doing.
  • PS --answering your original question, if you are paying for web hosting, chances are you will not be able to delete anything other than your own files. So yes protections are put up for the other system/server files and you just will simply not be able to delete them, no matter how much you want to.
  • Yes I am using shared hosting with site5. I think have already managed to delete my htaccess file contents. This happened when I uninstalled Microsoft Extensions, this seemed to delete the htaccess file. But I am now running wordpress on the server and it does not seem to have made any difference because it is running fine.

Next Topics on Trending Feed

  • 20

    This may seem a strange question. But when I am deleting files on my server using FTP is there away to stop accidentally deleting essential files used by the server? rather than just my own website files. Is there some way to tell which are the server files and which are your own? Are these files protected in some way to stop accidental deletion?