Undo sudo rm -R /*

37

Solution 1

There is no undo for sudo. It's a one time root runtime privilege. To better explain, it's like deleting your Win32 folder for Windows and wondering how to get it back. A simple re-install should fix your issue. I would recommend next time using man rm to better understand what the command does.

A simple reading of any terminal command before executing them would be in your best interest for you server, so no more unnecessary functions are carried out!

This should better Illustrate my meaning:

enter image description here

Solution 2

While there is no way to undelete the files

Your sites are still up so you can save the content from the browser. Of course if the sites are database driven then this will not help much.

But if your sites are mostly static html and they are still in memory, you can use some browser tool to save them from your browser.

There are some tools that can help with that, at the very least any browser can save complete html.

HTH

Share:
37
chad
Author by

chad

Updated on September 18, 2022

Comments

  • chad
    chad over 1 year

    In my program I have a file that contains the main function and another file that contains other functions. I have a struct and have created a vector of it:

    struct Animal {
        string name;
        string type;
        string regestration;
        int problem;
    };
    vector<Animal> animals;
    

    In my header file for the other functions I have the following:

    void loadAnimals(string &file, vector<Animal> animals);
    

    When compiling I get the error : 'Animal' was not declared in this scope for the above line.

    Do I need to declare the struct again in the header file? Or am I just using the wrong syntax

    • Jetson Earth
      Jetson Earth over 9 years
      You mean like restoring from backup?
    • Robobenklein
      Robobenklein over 9 years
      There is no 'simple' way to do so, a backup is indeed your best option. Otherwise you may need some seriously professional data forensics workers.
    • Thomas Ward
      Thomas Ward almost 3 years
      If you have no backups, you're hosed. No chance of restoring from this type of action if you don't have backups.
  • Andrew Lynch
    Andrew Lynch over 9 years
    I hate myself for being so stupid. If I reinstall Ubuntu 12.04 will my data be gone?
  • Virusboy
    Virusboy over 9 years
    Only if the Part is shared with your data. If so, yes. To be honest here no server should share data and OS.
  • Andrew Lynch
    Andrew Lynch over 9 years
    It's a dedicated server. So the entire server is mine. Hence why I was able to be so stupid.
  • Virusboy
    Virusboy over 9 years
    Yes but does your server have one hard drive/one Partition?
  • Andrew Lynch
    Andrew Lynch over 9 years
    Its on a single drive :/ . Any idea how all my sites are still running? I assume if I restart is game over.
  • Virusboy
    Virusboy over 9 years
    Yea your boned.
  • younes
    younes over 9 years
    it is a classical suicide attempt that has succeeded, better if you, take out your erver's hard driver and try to extract recent data (if there is any) and then reinstall/apply backup
  • Panther
    Panther over 9 years
    Your data is already gone, lol