How to take daily complete backup of my website automatically ? Need a script

Discussion in 'Site & Server Administration' started by poseidon, Mar 10, 2007.

  1. #1
    Guys, I need some code/script or way of taking daily complete backup of my site(including mysql databases). Any help will be highly appreciated :)
     
    poseidon, Mar 10, 2007 IP
  2. pixeldawn

    pixeldawn Well-Known Member

    Messages:
    763
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    130
    #2
    If your using cPanel there's a handy tool called MyCpanelBackup that you can use.
     
    pixeldawn, Mar 11, 2007 IP
    poseidon likes this.
  3. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #3
    agnivo007, Mar 11, 2007 IP
    poseidon and Pat Gael like this.
  4. poseidon

    poseidon Banned

    Messages:
    4,356
    Likes Received:
    246
    Best Answers:
    0
    Trophy Points:
    0
    #4
    @agnivo - Thanks alot, it turned out to be an awesome script. You seems to be helping me alot(few months back, you also replied to my cron question) :) and if I remember correctly, you are also from India(calcutta, right ?)

    Repped both of you for nice suggestions. Cheers
     
    poseidon, Mar 11, 2007 IP
    agnivo007 likes this.
  5. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #5
    cheers, no problem...yes, I'm from kolkata.
     
    agnivo007, Mar 12, 2007 IP
  6. GigaSEO.com

    GigaSEO.com Peon

    Messages:
    111
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Setup a cron job for the backup (shell command) and it will be done.
     
    GigaSEO.com, Mar 13, 2007 IP
  7. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Look into snapback2, should be able to google it. It depends on SSH (or rsync) access, but will take daily incremental backups. From the remote side.

    It's pretty configurable and seems to work well even for fairly large amounts of data. Basically it uses hard links, so say you have 10 files on your website. And none of them change. The first image will be a mirror of the 10 files, same size. The second day, no changes, the script will just create 10 hardlinks in a dated directory that will be a fraction of the size of your website.

    Say the third day, you change a file. In that dated directory, you'll have 9 hardlinks and one actual file. So still a fraction of the size.

    In this way you can keep a looong history of backups in a fairly small amount of space. I was backing up something like 10g and every rotation was a few hundred meg.. it all depends on how many files change and how often. But you will have completely live history of backups.

    Also, since it uses rsync, it only transfers parts of the files that have changed. So the first time, you d/l 100% of the file, if you make a minor change, next backup cycle you might only d/l 10% or 1% of the file, depending on it's size. So it makes the backups MUCH faster once you get the initial image.

    (The only other thing you have to do, is dump your DBs to a file, so they can get rotate regularly with everything else.)

    It's a little work, but it's very nice to have dated directories each holding a copy of your site, say for the last 30 days, 12 months and 2 years... however you set it up.

    Hope that helps!
     
    nddb, Mar 14, 2007 IP
  8. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,200
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #8
    Any chance you can send me the tool? mycpanelbackup.com appears to be down.
     
    dcristo, Apr 1, 2007 IP
  9. SemperFi

    SemperFi Well-Known Member

    Messages:
    458
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    120
    #9
    I just stated using Cabonite backup for personal use. You might check into them for professional use. http://www.carbonite.com/
     
    SemperFi, Apr 1, 2007 IP
  10. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Let me tried to decide if I should give you rep :rolleyes:

    Well, I will rep you now anyway, thanks :)
     
    Pat Gael, Apr 1, 2007 IP
  11. Artisan

    Artisan Well-Known Member

    Messages:
    635
    Likes Received:
    35
    Best Answers:
    1
    Trophy Points:
    128
    #11
    The main problem with MySQL database backups is that the complex database may be changing one file at a time just at the time of archiving, thus atomic transactions may be broken in the backup archives, in order to avoid this it may be a good idea to shut down MySQL server completely for several minutes at the time of archiving.
     
    Artisan, Apr 1, 2007 IP