• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Man accidentally 'deletes his entire company' with one line of bad code

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    We are all standing here looking smug but over the years I have seen dozens of scripts that use rm -rf ${WORKDIR} as a way to clean up temp directories. I have even seen examples that allow the sodding working directories to be passed in as an argument on the command line The fact that the poor idiot didn't think it was a good idea to have his backup directories unmounted when not in use just compounds the misery.

    There are only two types of people in this world those that have lost data and the rest of us....

    Comment


      #32
      If only he'd used Windows.

      Comment


        #33
        Originally posted by stek View Post
        Alexander?
        Oui.

        Comment


          #34
          Originally posted by bobspud View Post
          There are only two types of people in this world those that admit to have lost data and those that are lying.
          FTFY.
          Will work inside IR35. Or for food.

          Comment


            #35
            Originally posted by bobspud View Post
            We are all standing here looking smug but over the years I have seen dozens of scripts that use rm -rf ${WORKDIR} as a way to clean up temp directories. I have even seen examples that allow the sodding working directories to be passed in as an argument on the command line The fact that the poor idiot didn't think it was a good idea to have his backup directories unmounted when not in use just compounds the misery.

            There are only two types of people in this world those that have lost data and the rest of us....
            I got my tar command the wrong way round once, trounced everyones homes into an empty file. Even now when I use tar I check it and check it again!

            I never do the same wrong thing twice.....

            Comment


              #36
              Originally posted by stek View Post
              I got my tar command the wrong way round once
              Making it a rat?

              Comment


                #37
                Originally posted by barrydidit View Post
                Making it a rat?
                Filligree Siberian Hamster!

                Comment


                  #38
                  My colleague did that a couple of weeks ago, in the root directory logged in as root he did rm -Rf *...Everything gone, the whole system. Also attached was a NAS system and another storage system with about 120TB of data on it but we have it set up so that you can't delete anything off of it in this manner. Ha, did we take the mickey...

                  I wonder if the system was an EFI one because deleting /sys/firmware/efivars will brick it https://github.com/systemd/systemd/issues/2402
                  Brexit is having a wee in the middle of the room at a house party because nobody is talking to you, and then complaining about the smell.

                  Comment


                    #39
                    "The problem command was "rm -rf": a basic piece of code that will delete everything it is told to. The “rm” tells the computer to remove; the r deletes everything within a given directory; and the f stands for “force”, telling the computer to ignore the usual warnings that come when deleting files."

                    Years since I've done unix but even I remember that r is recursive. You don't need r to delete everything in the given directory. Shoddy reporting.

                    I managed to type * once in the directory where all the cron jobs were stored. Ctrl/C didn't kill it. Lots of cleanup required...

                    Comment


                      #40
                      Originally posted by darmstadt View Post
                      My colleague did that a couple of weeks ago, in the root directory logged in as root he did rm -Rf *...Everything gone, the whole system. Also attached was a NAS system and another storage system with about 120TB of data on it but we have it set up so that you can't delete anything off of it in this manner. Ha, did we take the mickey...

                      I wonder if the system was an EFI one because deleting /sys/firmware/efivars will brick it https://github.com/systemd/systemd/issues/2402
                      That's another issue, old Unixes traditionally had root's home on /, new fangled Linuxes etc stick root's home in /root, although Solaris 11 seems to do that now, AIX and HP-UX certainly don't.

                      I hate / being full of crap like dot directories and shell histories...

                      So nowadays if logged on as root not changing directory rm -rf will only delete roots files, not the root filesystem.

                      Comment

                      Working...
                      X