Big mistake

Discussion in 'General' started by tonytroy, May 27, 2014.

  1. tonytroy

    tonytroy Member

    Hey there,

    I've just done something really stupid..

    I was on the /web/cahe/smarty/compile/ folder of a website (it's a prestashop cms), and i've launch this remote :

    rm -rf /*

    Since then, I cannot access my server and all my websites are down...

    Does anyone have an idea of how can I fix this ? I really don't want to install ISP Config and all the websites again...


  2. neutrino

    neutrino Member

    well... rm -rf /* means you asked the system to destroy the whole filesystem mounted on /

    That might be everything depending on how you partitionned your hdd. Basicly you're pretty screwed since you are missing for sure /bin which contains all the system commands.

    If you have a complete system backup you should boot in rescue mode on the server (if that's possible) and copy your whole backup to the server.

    If you have no backup, you may start a fresh install.
  3. frprim

    frprim New Member

  4. tonytroy

    tonytroy Member

    Thx to both of you.

    I chose the easiest way and installed a new debian, it took me about an hour but now it's working fine.

    I have now to put back all the websites that was on this server... I think in a close future i'll find a way to backup files and DB on a remote server or something like a cloud !
  5. neutrino

    neutrino Member

    Good idea, a cheap and easy solution is a program called backup-manager on debian.

    To install it :

    apt-get install backup-manager
    When done you should edit the file /etc/backup-manager.conf to suit your needs (take your time). You will have to choose what you want to export, how you want to export your backups (ftp is the easiest way).

    An easy way to make the backup of the important folders is to have the export directories lines like this :

    export BM_TARBALL_BLACKLIST="bck tmp lost+found media mnt proc selinux srv sys"
    (/bck is the place where I store my backups, the place where the backup are should be exluded so change accordingly to your system)

    then create a script called in /root/backup/ containing this :

    test -x /usr/sbin/backup-manager || exit 0

    then edit your crontab and add this :

    0 1 * * * /root/backup/ >> /var/log/backup-manager.log 2>&1
    (This will make the backups and export them each night at 1:00 AM).

    Good luck !
  6. tonytroy

    tonytroy Member

    thx a lot neutrino :)

    i'll try this when i'll finished re-install everything on my server

Share This Page