Program... gone?

Hey guys,
I saved a program yesterday, i distinctly remember pressing Ctrl + S, but now when i just loaded the program, the latest code isnt there...
I dont know where it has gone, because i saved it, and when i closed down the Arduino environment, a box appeared i think, and I pressed save.

Any ideas on why this might have occurred?
Would it be possible to get the code back from the Arduino itself?

I was using Version 0017.

Thanks,
Conor

This was/is a bug in Arduino-0017. It is fixed in Arduino-0018.
Youre code is ...sorry to say that ... lost.
http://code.google.com/p/arduino/issues/detail?id=105
Eberhard

Would it be possible to get the code back from the Arduino itself?

Nope, fraid not :frowning:

Interesting bug I didn't know about - I am using 18 now, so it doesn't matter, but I am surprised I didn't hit it before on the project I am working on; I guess I got lucky...

:slight_smile:

ah rite :frowning:
OK, well thanks for the replies.

I guess that now the code is gone, i can have a second attempt at it, but this time make it better than the first time.

Cheers,
Conor

I guess that now the code is gone, i can have a second attempt at it, but this time make it better than the first time.

I feel your loss! This kind of thing has happenned to people since the dawn of computers, I think.

After having it happen to me several times waaay back in high school (on the cheapo Apple 2e floppy drives that would croak if you looked at 'em sideways), I started making backups of everything I did.

Today I have a fileserver (using http://freenas.org/) that is separate from all the other computers in the house sitting on my network. Every hour (also at shutdown and reboot), each workstation backs up its home directory (plus any others I care to add) to a central location on the fileserver, which has 800 GB of storage. At some point soon I am planning on adding another drive to have that server auto-backup to, but so far this system has worked out well.

In the worst case, I will only lose an hour's worth of work, which is acceptable to me for my work patterns.

One time I did have a failure (using a different backup system, but about the same nonetheless) where my hard drive croaked in one of my workstations; after a trip to Fry's Electronics and a few hours of work, I had my system back up with all the data (minus the time between it dying and the last backup) back in place.

Such an automated backup system is well worth the investment of time and money, IMO; if you didn't want to go to the expense of a complete file server (I use mine for other things as well - MP3s, videos, document sharing, reference repository, etc - it serves all the workstations in the house), then even a portable/pocket hard drive (heck, even a large thumbdrive) can be used; if you are on Windows like most people, I think there is a built-in simple automated backup system (hmm - looking at XP right now, there is something called "backup" under System Tools; that would probably be it).

All of my workstations at home run Ubuntu, so I use the simple incremental backup system it comes with (plus some custom scripting and cron setup to make it work right - as well as on shutdown/reboot).

There is likely something just as easy to use on Macs.

Let this be your "wake up call"; invest in a backup solution (even if it is just a second old hard drive inside your case) - learn to use it, learn to love it, learn to quit worrying (ok, you never quit worrying - like I said before, I am now thinking of a backup solution for my backup solution).

:slight_smile:

Hi,
while everything you said about backups is right, it wouldn't have helped here.
Beacuse of the application bug the code never even made it onto the harddisk to be backed up.

Eberhard

BTW: The IDE does not even make a single backup version of a code file when saving, (what you might expect because the other 25.000.000 code editors on this planet do this)

Having been a programmer for more years than I like to think about I've been bitten by this kind of thing so many times that I'm now paranoid about backing up.

In addition to making frequent backups manually (to different locations) I now run the "Non-Stop" backup function of Acronis True Image Home 2010 which in the few months I've been using it has saved me twice. It runs in background and I hardly notice it's there.

I've devoted a hard drive to backups.

I'll quote from Acronis' explanation of how it works:

Acronis Nonstop Backup provides easy protection of your disks and files, and allows you to recover both entire disks and individual files and even their versions from disaster. By default Nonstop Backup will protect your system partition, though you can select other partitions and disks for protection as well.

Once you start Acronis Nonstop Backup, it will perform an initial image backup of the partition(s) selected for protection. Having finished this task, Acronis Nonstop Backup will save changes in your system and files (including open ones) every five minutes, so you will be able to recover your system to an exact state in time.

States of the protected partitions will be backed up at 5-minute intervals for the last 24 hours. The older backups will be consolidated in such a way that Acronis True Image Home will keep daily backups for the last 30 days and weekly backups until all Nonstop Backup storage space is used.

The one thing I've learned, and I do it nearly automatic, is to press cntrl+s every minute and/or every other line I write.

I don't usually bother with backups, anything that I deem important usually ends up in 2~3 different places (my server, USB sticks, website, a mates computer, etc. etc.).

while everything you said about backups is right, it wouldn't have helped here.
Beacuse of the application bug the code never even made it onto the harddisk to be backed up.

wayoda, at that specific moment in time, no it wouldn't have helped. However, it would have helped in his case to not lose everything, but only lose what was last changed since the last "good" save - instead of losing everything, he would have only lost was was changed (unless it was his unlucky day and the code was typed in from scratch, saved, hit the bug, and didn't know; then nothing would've helped, I suppose, short of something that backed up from RAM to disk).

I don't usually bother with backups, anything that I deem important usually ends up in 2~3 different places (my server, USB sticks, website, a mates computer, etc. etc.).

Well, Imahilus, you essentially have an ad-hoc version of "backup" going - but it isn't a true backup solution. With the system I have set up, it is "set and forget"; I check it every now and again to make sure the backup system still works (especially after doing any upgrades under Ubuntu), but I have never seen any problems with it. The simple built-in backup system that I use (I use a lightweight backup program that comes with Ubuntu; if I really wanted to be hardcore, I would use rsync; FreeNAS supports it directly, but it is really overkill for workstation backups - I might use it, though, when I build my FreeNAS server backup solution) does incremental backups, so each new backup that is done hourly takes minimal (if any) space. I can (in theory - though I have never tried) do a "rolled back" recovery (in the event that I saved something over something I didn't want to overwrite). Also, every month the system does a "full backup" and removes the incremental images. It is really a tight system, and works well for my needs. It cost me nothing but some time and the cost of hard drives to setup (I used a couple of 400 gig PATA ide specials from geeks.com to build the system - they cost $40.00 each; the rest came from my junk pile).

Believe me, the peace of mind is well worth it to me...

:slight_smile: