Learn about Centmin Mod LEMP Stack today
Become a Member

Sysadmin MaxMind Script, deleted all my DB's

Discussion in 'System Administration' started by Oxide, Jun 14, 2016.

  1. Oxide

    Oxide Active Member

    502
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:13 PM
    I went to access my server today, and manually ran the maxmind script to pull databases...

    As normally i execute it, when I did.. I realized my access/key has expired to download organizations.. The entire script glitched out and all the text on the screen became yellow. I tried to cd out of the folder, it said "cd not found" or something like that so I thought, oh well it probaly glitched out.

    Next thing i tried, was accessing SSH. No, that didn't work, worng pasword.. I was like, oh wow it prob changed password somehow.. So i went into OVH Rescue mode.

    What i found, was only /home left existing on my server. Databases and everything else was completely removed...

    How is this even possible?

    I am going to reinstall my server now. At least I've managed to download the scripts, but databases nope. No backups sadly.
     
    • Informative Informative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5
    what maxmind script ?

    really depends on what the maxmind script code was

    i'd make sure databases and stuff was removed first though.. maybe OVH Rescue mode hides partitions ? never used OVH Rescure mode myself

    OVH : RescueMode
     
  3. Oxide

    Oxide Active Member

    502
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:13 PM
    Hope not - already started reinstalling with original kernel this time.

    It was this one: add tools/geoipdb-update.sh · centminmod/centminmod@4f4c5c3 · GitHub

    I just modified it a little to add support for their Org/ISP.
     
  4. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5
  5. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5
  6. Oxide

    Oxide Active Member

    502
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:13 PM
    i only had two, i everything inside bin was also deleted and i couldnt even access it after running it so i just reinstalled.

    i had the script located inside /usr/sbin or something, it seemed to delete everything inside there and databases ++ somehow.. but not home folder.
     
  7. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5
    the original (not your modified version) of geoipdb-update.sh script doesn't have any code that would delete partitions, it only removes 2 specific files
    Code (Text):
    rm -rf /usr/share/GeoIP/GeoIP.dat
    rm -rf /usr/share/GeoIP/GeoIPCity.dat
     
  8. Oxide

    Oxide Active Member

    502
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:13 PM
    yeah i modified it and added rm -rf *

    i assume it failed to cd to that dir, so it rm -rf*d my entire server lol, well whatever.

    trying to install centmin but it's downloading at 1kbps or so now.. @ovh

    Testing download speed........................................
    Download: 1.96 Mbit/s

    No idea what's going on. Not sure if it has anything to do with me selecting normal kernel instead of ovh kernel this time..
     
  9. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5
    i'd contact OVH support and ask about OVH Rescure mode and where disk partitions need to be remounted to view as that is a more likely scenario
     
  10. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5
    ouch ... whenever you delete files or directories via SSH command or scripts, always change into directory you want to delete or where the file is located to limit your mistakes. If file or directory is in root / then be extra careful

    so if you want to delete directory at
    Code (Text):
    cd /home/nginx/domains/mydomain.com
    rm -rf /home/nginx/domains/mydomain.com

    if you want to delete contents of /home/nginx/domains/mydomain.com/public/directory
    Code (Text):
    cd /home/nginx/domains/mydomain.com/public/directory
    rm -rf /home/nginx/domains/mydomain.com/public/directory/*


    probably just slow
     
  11. Oxide

    Oxide Active Member

    502
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:13 PM
    Yeah..

    Receiving objects: 37% (4820/12869), 152.63 MiB | 65.00 KiB/s

    Guess I'll just let it run for a while. It was faster with everything else lol.
     
  12. Oxide

    Oxide Active Member

    502
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:13 PM
    Just to not waste my time @eva2000 - i first git clone centminmod branch then pull/update the BETA?
     
  13. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5
  14. Oxide

    Oxide Active Member

    502
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:13 PM
    Just to make it clear.

    Which one would you suggest installing, 123.08beta03? or 123.08beta01.. or what version, i have no clue =)
     
  15. pamamolf

    pamamolf Well-Known Member

    2,538
    231
    63
    May 31, 2014
    Ratings:
    +394
    Local Time:
    6:13 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Just use latest beta 09 as it is very stable :)

    @eva2000

    Running:
    Code:
    rm -rf /home/nginx/domains/mydomain.com/public/directory/*
    without running first:
    Code:
    cd /home/nginx/domains/mydomain.com/public/directory
    it will delete all folders?
     
  16. Oxide

    Oxide Active Member

    502
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    1:13 PM
    hmm okay, that includes php 7 and all those updates right?

    also would it be possible to manually download the files then upload via ftp to my server? my server seems to have VERY slow connection to github
     
  17. pamamolf

    pamamolf Well-Known Member

    2,538
    231
    63
    May 31, 2014
    Ratings:
    +394
    Local Time:
    6:13 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Yes it has everything and yes you can download it and then upload it to /usr/local/src/ and install it from there :)
     
  18. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5
    doh yes will delete everything in /home/nginx/domains/mydomain.com/public/directory/ folders and files.. the cd is optional but get into habit of doing it so it becomes second nature. Train yourself to always cd before delete - if you don't you may do a rm -rf * on the wrong directory if you forgot to cd :)
     
  19. eva2000

    eva2000 Administrator Staff Member

    29,051
    6,593
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,789
    Local Time:
    1:13 PM
    Nginx 1.13.x
    MariaDB 5.5