Mac How do you backup your code?

HarryPot

macrumors 65816
Original poster
Sep 5, 2009
1,001
386
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. =)
 

xStep

macrumors 68020
Jan 28, 2003
2,013
100
Less lost in L.A.
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.
 
  • Like
Reactions: HarryPot

firewood

macrumors 604
Jul 29, 2003
7,824
1,082
Silicon Valley
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).
 
  • Like
Reactions: HarryPot

alphaod

macrumors Core
Feb 9, 2008
22,176
1,228
NYC
External non-attached drive (now I use SSDs) and archive gold quality optical media; I prefer Verbatim for the latter.
 
  • Like
Reactions: HarryPot

teagls

macrumors regular
May 16, 2013
181
75
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. =)
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.
 
  • Like
Reactions: HarryPot

glutenenvy

macrumors regular
Sep 6, 2011
175
21
WA
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.
 

HarryPot

macrumors 65816
Original poster
Sep 5, 2009
1,001
386
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.
 

firewood

macrumors 604
Jul 29, 2003
7,824
1,082
Silicon Valley
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.
 
Last edited:

Phil A.

Moderator
Staff member
Apr 2, 2006
5,550
2,421
Shropshire, UK
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.

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

960design

macrumors 68040
Apr 17, 2012
3,023
968
Destin, FL
Thanks for any ideas. =)
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.
 

ChrisA

macrumors G4
Jan 5, 2006
11,652
456
Redondo Beach, California
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. =)

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
 

HarryPot

macrumors 65816
Original poster
Sep 5, 2009
1,001
386
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.
 

firewood

macrumors 604
Jul 29, 2003
7,824
1,082
Silicon Valley
... and also will backup the latest version of my code to my iCloud Drive.
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.
 

HarryPot

macrumors 65816
Original poster
Sep 5, 2009
1,001
386
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.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.