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

0 Members and 1 Guest are viewing this topic.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
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 off
copy c:\asm\source\%1.z80 %1.z80 > nul
copy %1.z80 c:\backups\%1.z80 > nul         --  this is the new line
spasm %1.z80 c:\asm\exec\%1.8xp
del %1.z80 > nul
time /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
  • Losing your computer


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

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
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 O.O

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
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).

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
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 O.O

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