### Author Topic: Simple way to backup sources  (Read 1766 times)

0 Members and 1 Guest are viewing this topic.

#### thepenguin77

• z80 Assembly Master
• LV10 31337 u53r (Next: 2000)
• Posts: 1591
• Rating: +823/-5
• The game in my avatar is bit.ly/p0zPWu
##### Simple way to backup sources
« on: May 05, 2013, 06:58:52 pm »
A long time ago, I accidentally deleted the source to my Impossible Game with a batch file. Since I did it with a batch file, it didn't go to the recycle bin and was gone forever.

This is a backup technique that would have prevented that from happening. This won't protect you from hard drive crashes and the like, but it's so simple that you really have no reason not to do it.

Step 1:
Make a folder somewhere far away from your sources folder
My sources are C:\Asm\Sources so I made C:\Backups (a different drive would have been better, but oh well)
Step 2:
Edit your asm.bat (or whatever you use) to include this line to copy whatever source you are compiling into that folder
Mine looks like this:
Code: [Select]
@echo offcopy c:\asm\source\%1.z80 %1.z80 > nulcopy %1.z80 c:\backups\%1.z80 > nul         --  this is the new linespasm %1.z80 c:\asm\exec\%1.8xpdel %1.z80 > nultime /T                                  --  displays the current time, also a good idea
Done!

What this protects against:
• Deleting a source file
• Weird .bat file mistakes
• Deleting your source folder (!)
• Saving over your source file (as long as you don't assembling the new one)

What this doesn't protect against:
• Deleting everything in the file, saving, assembling
• Hard drive crashes

So, while this isn't the most thorough option, it would have prevented me from losing my source.
zStart v1.3.013 9-20-2013
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
-Runer112

#### Sorunome

• Fox Fox Fox Fox Fox Fox Fox!
• Support Staff
• LV13 Extreme Addict (Next: 9001)
• Posts: 7920
• Rating: +374/-13
• Derpy Hooves
##### Re: Simple way to backup sources
« Reply #1 on: May 05, 2013, 07:40:11 pm »
Nice idea, and how did you restore your impossible game files
 THE GAMEAlso, check out my websiteIf OmnomIRC is screwed up, blame me!Click here to give me an internet!

#### Streetwalrus

• LV12 Extreme Poster (Next: 5000)
• Posts: 3821
• Rating: +80/-8
##### Re: Simple way to backup sources
« Reply #2 on: May 06, 2013, 11:03:48 am »
Nice idea indeed. This could be improved by copying to Dropbox (IIRC it even has version management).

#### thepenguin77

• z80 Assembly Master
• LV10 31337 u53r (Next: 2000)
• Posts: 1591
• Rating: +823/-5
• The game in my avatar is bit.ly/p0zPWu
##### Re: Simple way to backup sources
« Reply #3 on: May 06, 2013, 11:45:31 am »
Nice idea, and how did you restore your impossible game files

I disassembled it with IDA almost immediately. Since I had just written it, I was able to get all of my labels and variable names back to what they were originally, but the formatting of the whole thing was a mess. About a year later I wrote a program to remove all of the stupid comments and put it back in the format that I write programs in.
zStart v1.3.013 9-20-2013
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
-Runer112