oh snap... you rekt...

Forum for off topic and general discussion.

oh snap... you rekt...

Postby Heffernan » Fri Apr 15, 2016 10:39 am

http://www.independent.co.uk/life-style ... 84256.html

http://serverfault.com/questions/769357 ... om-a-rm-rf

I run a small hosting provider with more or less 1535 customers and I use Ansible to automate some operations to be run on all servers. Last night I accidentally ran, on all servers, a Bash script with a rm -rf {foo}/{bar} with those variables undefined due to a bug in the code above this line.

All servers got deleted and the offsite backups too because the remote storage was mounted just before by the same script (that is a backup maintenance script).

How I can recover from a rm -rf / now in a timely manner?
User avatar
Heffernan
 
Posts: 8564
Joined: Mon Sep 08, 2014 3:07 pm
Location: Marps Closet

Re: oh snap... you rekt...

Postby Thor » Fri Apr 15, 2016 10:48 am

Best to not code drunk.
saltmummy wrote:You sad sad little man, my heart weeps for you. Better not go outside or your thin, tissue paper like skin might spontaneously rupture while your fragile sensibilities violently shatter spraying salt and urine all over the street.
User avatar
Thor
 
Posts: 2335
Joined: Wed Jun 12, 2013 10:09 am

Re: oh snap... you rekt...

Postby Forungi » Fri Apr 15, 2016 11:22 am

¦] Best troll of 2016 confirmed ¦]
Forungi
 
Posts: 753
Joined: Tue Jun 23, 2015 3:31 pm

Re: oh snap... you rekt...

Postby Kandarim » Fri Apr 15, 2016 11:53 am

and that, children, is why you always dry-run a script involving rm.

Also, I am pretty sure it's just a troll post. rm uses --preserve-root by default (don't remove "/"), which no sane person would ever turn off.
I have neither the crayons nor the time to explain it to you.
JC wrote:I'm not fully committed to being wrong on that yet.
User avatar
Kandarim
Customer
 
Posts: 5321
Joined: Mon Jan 21, 2013 4:18 pm

Re: oh snap... you rekt...

Postby Qiresea » Fri Apr 15, 2016 12:35 pm

that can't be true. what kind of an idiot would run an rm -rf, seriously... :lol:
Darwoth wrote:It really is not fair that every time you try to jab at me you make yourself look more retarded than any retort i could come up with.

Image
Γιά την Κυρία των τριών βασιλείων: της γης, του ουρανού και της θάλασσας.
User avatar
Qiresea
Customer
 
Posts: 1089
Joined: Tue Feb 17, 2015 3:01 pm

Re: oh snap... you rekt...

Postby Kandarim » Fri Apr 15, 2016 12:55 pm

rm -rf is used quite often, and occasionally even in scripts like the above one.
However, you should never ever turn off --preserve-root. There have been cases of hardbricking laptops (because, as I recall, the UEFI motherboard settings can be removed through linux mountpoints)...

FFR, the safe usage is not to include any slashes whatsoever in your rm command, i.e. doing
cd /dir/path/
rm -rf dir

Still, I think the above issues deserved it for their careless use of rm. Seriously, who 'accidentally's --no-preserve-root?
I have neither the crayons nor the time to explain it to you.
JC wrote:I'm not fully committed to being wrong on that yet.
User avatar
Kandarim
Customer
 
Posts: 5321
Joined: Mon Jan 21, 2013 4:18 pm

Re: oh snap... you rekt...

Postby saltmummy » Fri Apr 15, 2016 6:56 pm

Good luck getting a new job in the programming sector after this.
Darwoth wrote:you know, cause they were obviously fascist white supremacist burrito nazis.

I had a great dream where I was a handsome skeleton in a tower.
Image
User avatar
saltmummy
 
Posts: 1112
Joined: Tue Jun 02, 2015 9:24 am
Location: The graveyard

Re: oh snap... you rekt...

Postby Inotdead » Sun Apr 17, 2016 9:04 am

Wow.

I'll just pretend that it was intentional sabotage and the man got bribed to do that.
Claeyt wrote: I'm not saying it's right or justified that they steal or sell drugs or murder cops I'm saying that that's exactly what you would do if you were poor and desperate and Black.
User avatar
Inotdead
 
Posts: 723
Joined: Mon Nov 26, 2012 10:39 am

Re: oh snap... you rekt...

Postby Dallane » Sun Apr 17, 2016 12:30 pm

saltmummy wrote:Good luck getting a new job in the programming sector after this.


This wont affect anything with getting jobs.
Please click this link for a better salem forum experience

TotalyMeow wrote: Claeyt's perspective of Salem and what it's about is very different from the devs and in many cases is completely the opposite of what we believe.
User avatar
Dallane
Moderator
 
Posts: 15195
Joined: Wed Aug 01, 2012 2:00 pm

Re: oh snap... you rekt...

Postby Heffernan » Sun Apr 17, 2016 12:48 pm

Dallane wrote:
saltmummy wrote:Good luck getting a new job in the programming sector after this.


This wont affect anything with getting jobs.


yeah right? how would destroying a whole company not get him a new job.... right guys...?
User avatar
Heffernan
 
Posts: 8564
Joined: Mon Sep 08, 2014 3:07 pm
Location: Marps Closet

Next

Return to City upon a Hill

Who is online

Users browsing this forum: No registered users and 6 guests