Is it possible to accidently delete server files?

17 replies
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?
#accidently #delete #files #server
  • Profile picture of the author Ross Dalangin
    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
    {{ DiscussionBoard.errors[373960].message }}
  • Profile picture of the author madison_avenue
    Thanks for reply Ross: I guess it's always risky, but better safe than sorry with a back up.
    {{ DiscussionBoard.errors[373963].message }}
  • Profile picture of the author write-stuff
    Yeah, like Ross said, keep a backup. And then the obvious answer: be more careful. Happy 2009. - Russ
    {{ DiscussionBoard.errors[374011].message }}
  • Profile picture of the author n7 Studios
    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!
    {{ DiscussionBoard.errors[374889].message }}
  • Profile picture of the author madison_avenue
    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.
    {{ DiscussionBoard.errors[374964].message }}
    • Profile picture of the author Karen Blundell
      only deal with the public_html folder...don't mess with anything else
      Signature
      ---------------
      {{ DiscussionBoard.errors[375631].message }}
    • Profile picture of the author n7 Studios
      Originally Posted by madison_avenue View Post

      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.
      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).
      {{ DiscussionBoard.errors[376951].message }}
  • Profile picture of the author improvingtheweb
    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
    {{ DiscussionBoard.errors[377644].message }}
  • Profile picture of the author madison_avenue
    Thanks for reply improvingtheweb. I going to have word with my web host about this to see if they can do it for me.
    {{ DiscussionBoard.errors[381731].message }}
  • Profile picture of the author Shadi
    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
    {{ DiscussionBoard.errors[383006].message }}
  • Profile picture of the author thehypnoguy2
    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
    {{ DiscussionBoard.errors[388905].message }}
  • Profile picture of the author madison_avenue
    Thanks for the info guys. I will be sticking to the public_html folder from now on!
    {{ DiscussionBoard.errors[390014].message }}
  • Profile picture of the author Jeffery
    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% :-)
    Signature
    In the minute it took me to write this post.. someone died of Covid 19. RIP.
    {{ DiscussionBoard.errors[390027].message }}
  • Profile picture of the author madison_avenue
    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.
    {{ DiscussionBoard.errors[390213].message }}
  • Profile picture of the author Johnathan
    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.
    Signature
    Make money from writing, find out how now.
    {{ DiscussionBoard.errors[390456].message }}
  • Profile picture of the author Johnathan
    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.
    Signature
    Make money from writing, find out how now.
    {{ DiscussionBoard.errors[390458].message }}
  • Profile picture of the author madison_avenue
    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.
    {{ DiscussionBoard.errors[390800].message }}

Trending Topics