• 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!

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

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

Collapse

  • NickFitz
    replied
    And, as usual, a bunch of people who had nothing to do with it are left to clean up the mess: What to do with the "rm -rf" hoax question - Meta Server Fault

    Leave a comment:


  • mudskipper
    replied
    Originally posted by Contreras View Post
    Yep. now marked as a hoax.
    WHS That man who ‘deleted his entire company’ with a line of code? It was a hoax | PCWorld

    Hilarious.

    Leave a comment:


  • Contreras
    replied
    Originally posted by NickFitz View Post
    Some have seen this as evidence that he's just trolling; but we've all done something like that (though hopefully less catastrophically), so maybe not
    Yep. now marked as a hoax.

    Reminds me of the first week of my first 'real' job as apprentice. Inquisitive me, knowing a bit about computers, was left to have a play with the office PC. Later that day their IT help desk fell about laughing as I explained how it had stopped working after running something called "FDISK".

    Couple of tricks that would have saved the day though:

    Code:
    ~$ cat doh
    #! /bin/bash
    set -u
    rm "${foo}/${bar}"
    
    ~$ ./doh
    ./doh: line 3: foo: unbound variable
    
    ~$ cat duh
    #! /bin/bash
    rm "${foo:?}/${bar:?}"
    
    ~$ ./duh
    ./duh: line 2: foo: parameter null or not set

    Leave a comment:


  • Mordac
    replied
    Originally posted by stek View Post
    Most likely though as it was a VM the 'hard disk' would be dotted about on the underlying RAID6 on the SAN....
    Then he's a bigger bell-end than I was about to give him credit for...

    Leave a comment:


  • stek
    replied
    Originally posted by Mordac View Post
    I'd be tempted to offer to help, there's almost nothing that can't be recovered from a working hard disk, even after it has been deleted. Just a question of how much to charge...
    Most likely though as it was a VM the 'hard disk' would be dotted about on the underlying RAID6 on the SAN....

    Leave a comment:


  • Mordac
    replied
    I'd be tempted to offer to help, there's almost nothing that can't be recovered from a working hard disk, even after it has been deleted. Just a question of how much to charge...

    Leave a comment:


  • Hobosapien
    replied
    All these tails of woe. Someday someone will invent 'undelete'.

    Leave a comment:


  • stek
    replied
    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.

    Leave a comment:


  • mudskipper
    replied
    "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...

    Leave a comment:


  • darmstadt
    replied
    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

    Leave a comment:


  • stek
    replied
    Originally posted by barrydidit View Post
    Making it a rat?
    Filligree Siberian Hamster!

    Leave a comment:


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

    Leave a comment:


  • stek
    replied
    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.....

    Leave a comment:


  • VectraMan
    replied
    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.

    Leave a comment:


  • jamesbrown
    replied
    Originally posted by stek View Post
    Alexander?
    Oui.

    Leave a comment:

Working...
X