How do you backup your code?

Discussion in 'Mac Programming' started by HarryPot, Apr 20, 2016.

  1. HarryPot macrumors 6502a

    Joined:
    Sep 5, 2009
    #1
    For the last year, I've been thinking about improving my backup strategies.

    We are a team of three developers, and so far we keep local backups in encrypted hard drives. One hard drive is always connected to the main computer/server and making backups daily. Once a week we swap this hard drive for one stored in another location.

    So far, we have never been in need of requiring a backup. But I've always been concerned about only having local backups. Specially since at times (when swapping hard drives) all the information is in the same place at the same exact time.

    I could easily add a new third hard drive, but I'm not sure this is the best solution.

    Any ideas? Anyone here uses online backups?


    Thanks for any ideas. =)
     
  2. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #2
    First, review this current thead regarding git.

    Im using bitbucket because you can have up to 5 private repositories for free. When I add the sixth project I'll start paying for the service. I too like having an off site option and using a cloud service is currently my only option.

    Until recently I had an off site option where I stored my backup drive. That's fine for single developer like me and a team that shares a single working environment. If your team is distributed, then a cloud option or shared server is the best way to go.
     
  3. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #3
    The canonical way to safely swap backup drives is to use at least 3 drives, one local, one remote, and one possibly in transit or being swapped. That way there is always at least one drive at the remote site.

    However, a preferred remote site is one that is in a completely different geography: far from the same theft, fire, earthquake, hurricane, tornado, tsunami, flood, volcanic eruption, or other natural disaster zone. The easiest way to do that is by a renting a storage server or servers on other continents, and periodically uploading a rotation of source code repositories or dmg's (encrypted if needed).
     
  4. alphaod macrumors Core

    alphaod

    Joined:
    Feb 9, 2008
    Location:
    NYC
    #4
    External non-attached drive (now I use SSDs) and archive gold quality optical media; I prefer Verbatim for the latter.
     
  5. teagls macrumors regular

    Joined:
    May 16, 2013
    #5
    If you want code management type back up. There is github which has paid private accounts. I use that for specific projects. If you are just looking to back up data you could use AWS. There are different types of storage like glacier, for very in frequent access like backups.
     
  6. glutenenvy macrumors regular

    glutenenvy

    Joined:
    Sep 6, 2011
    Location:
    WA
    #6
    Another vote for the additional optical media. It is the only write once media in popularity even though it is declining. With ransomware picking up, a stack of optical disks are going to be easier to reconstruct than your files that have been slowly encrypted or suffered bit creep over time without your knowledge. An additional layer of protection can be added to the optical setup by only reading from backups on drives without write capability.

    I'm all for automated backups on cloud, hard disk, etc., but they are susceptible to a attack by purpose or by error. It is like a hard disk slowly giving up instead of hard crashing.
     
  7. HarryPot thread starter macrumors 6502a

    Joined:
    Sep 5, 2009
    #7
    Thanks!

    I think adding the third hard drive is a no brainer. As for optical media, it is so easy to do it, I might as well do it once a month.

    In the case of cloud backups, I'm still undecided. GitHub, BitBucket and those services have never appealed to me. Maybe because of my ignorance, but also because I feel they are not really secure.
     
  8. firewood, Apr 22, 2016
    Last edited: Apr 22, 2016

    firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #8
    If you don't trust GitHub, GitLab provides source code so you can host your own on a private server somewhere. Hopefully somewhere far away where a tsunami (etc.) won't drown both your office and your friends house with the remote drives and optical media.

    As for optical media, make sure you can actually read all of your backups on new completely different hardware than used for writing them. I've heard too many stories about unreadable optical discs, DVDs, and tapes, or ones that went bad halfway in. I have one tape that reads just fine, buy only on one drive on a long dead PC.
     
  9. robvas macrumors 68020

    Joined:
    Mar 29, 2009
    Location:
    USA
  10. Phil A. Moderator

    Phil A.

    Staff Member

    Joined:
    Apr 2, 2006
    Location:
    Shropshire, UK
    #10

    BitBucket allows you unlimited private repos (I've got 24) - it's the number of users of your repos that's limited to 5
     
  11. 960design macrumors 68000

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #11
    I write most of my code with Coda2 using a MBPr. Time Machine does constant local backups to a 3T NAS. Coda has fantastic GIT integration for remote backups at the end of each function / section of code. This all makes for easy 'roll backs' and file->file comparisons.
     
  12. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #12

    First off Set up Time Machine. It will make hourly backups. It will keep old versions of all your files. It is not perfect but it is a good first line of defense system. Every Mac should have its own TM disk that is about 2X the size of al the data on that mac.

    Backups ALWAYS need to keep older versions. Never to the "close the disk" type backup, especially if backing up code. Here is why: Lets say you have a file up in an editor and accidentally delta a few hundred lines but don't notice right away. That is fine because you have a backup. But then you run the backup and it over writes your only good copy.

    Years ago we all used to use tape for backup. And of course for the above reason we'd try to not write new data over old data so we rotated 50 or even 100 reels of tape so we could restore months old files. (yes I can remember 10" reel to reel computer tape back in the 1970's) Nothing has changed. You still need to rotate media, keep old data, old versions of all your files.

    You need the on-line, real-time continuous backup that Time Machine gives you and also you can push data to a remote server or even two remote servers and keep your off site copies continuously up to date too. No reason to wait until the end of the day or week to do a backup, it can run continuously.

    I would still add a cloud based service just as a last ditch backup. Use Amazon's storage or back blaze or whatever

    When you design the backup system keep in mind the threats to the data you are trying to protect from. The most common causes for lose of data are
    1) theft of the equipment (some one steals the notebook computer from our car)
    2) disaster like a fire, flood or lightening strike to a nearby power pole. (guess what EVERYONE whose house burned down said "it's unlikely my house will burn down." before it happened.
    3) User error. Deleted data by accident. (like the fire, everyone said "can't happen to me.")
    4) software error. The OS or editor has a bug and corrupts the file
    5) hard drive failure. This happens but is not the major cause for loss of data

    Make sure your plan
     
  13. HarryPot thread starter macrumors 6502a

    Joined:
    Sep 5, 2009
    #13
    Thanks a lot for the input!

    I think I'm going to research more about BitBucket.

    For the meantime, I will add a new hard drive, and also will backup the latest version of my code to my iCloud Drive.
     
  14. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #14
    Best practice is to backup *all* versions of your source code using a version control system. git comes built into Xcode, but defaults to putting the version repository inside a hidden directory inside your project folder/directory. If so, you may have to manually copy/backup this repository to somewhere safe.
     
  15. HarryPot thread starter macrumors 6502a

    Joined:
    Sep 5, 2009
    #15

    Yes, I'm beginning to understand the benefits of using BitBucket or a similar Git It makes everything more organized and easier to keep an easy access.

    Right now I make manual backups of all my publications and all my code versions in development.
     

Share This Page