Evan's Project AutoBackup For those who don't use source control

Evanski

Raccoon Lord
Forum Staff
Moderator
I'm not sure if this is the right place for this topic but, Moved to the correct spot, Thanks Chance!

I made a tool for window users to automatically backup there project directory in case of any accident resulting in data loss.
This only works on windows as it is a batch file command.

HOW IT WORKS AND HOW TO USE
PUT THE BATCH FILE ON YOUR DESKTOP!!! DO NOT PUT IT ANYWHERE ELSE I'M NOT RESPONSIBLE FOR ANY ACCIDENTAL DAMAGE! (really it shouldnt be a problem but batchfiles are very picky)
if you read that and accept that I'm not responsible for any misuse of the program then open the spoiler below
password is "ineedbackup"

The batch file asks for the location of the folder you save your projects into and copies them to your desktop
If you have 7zip you can use the option to zip the newly created backup for you.
The batch file will tell you the amount of time it takes to back up your files and how long it takes to zip the backup folder.

Version 1 error: The time calculation is a bodge because batch for whatever reason hates math with time and ever 2/10 runs of the batch file it will give some wrong calculation of time passed and with some ignore-able error about not having a real number to do math with

I guess you could just copy this to a text file and run it as a .bat
again I take no responsibility if you use this in any other way then how I say to use it
Code:
:BULL💩💩💩💩
color 0a
TITLE EvanSki's AutoBackup V.1.0
goto SETUP


:SETUP
@echo off
cls
echo INPUT DIRECTORY OF GAMEMAKER PROJECTS FOLDER IE:(C:\Users\YOURNAME\Documents\GameMakerStudio2\projects)
set /p projdir=

::SET THE START TIME OF THE BATCH FILE
set STARTTIME=%time%
set STARTHH=%STARTTIME:~0,2%
set STARTMI=%STARTTIME:~3,2%
set STARTSS=%STARTTIME:~6,2%
set STARTFF=%STARTTIME:~9,2%

goto BACKUP_START

:BACKUP_START
cls
echo BACKUP STARTING...
set Desktop=%CD%
set DDMMYYYY=%DATE:~7,2%_%DATE:~4,2%_%DATE:~10,4%
echo %DDMMYYYY%
md  "%DDMMYYYY%"
cls
echo BACKUP FOLDER CREATED! STARTING BACKUP...
ping localhost -n 3 >nul
cd %projdir%
xcopy /s "%projdir%\*" "%DESKTOP%\%DDMMYYYY%" /i
ping localhost -n 3 >nul
goto CALCTIME

:CALCTIME
cls
:: SET STOP TIME FOR BATCH FILE
set STOPTIME=%time%

echo BACKUP COMPLETED!
echo _______________________
echo StartTime : %STARTTIME%
echo EndTime   : %STOPTIME%
echo _______________________

::GET EXACT END TIME
set ENDHH=%STOPTIME:~0,2%
set ENDMI=%STOPTIME:~3,2%
set ENDSS=%STOPTIME:~6,2%
set ENDFF=%STOPTIME:~9,2%

set /a FINALHH= %ENDHH%-%STARTHH%
set /a FINALMI= %ENDMI%-%STARTMI%
set /a FINALSS= %ENDSS%-%STARTSS%
set /a FINALFF= %ENDFF%-%STARTFF%

echo COMPLETED IN:
echo %FINALHH% Hours
echo %FINALMI% Mins
echo %FINALSS% Secs
echo %FINALFF% MSecs
echo .
echo .
ping localhost -n 3 >nul
::ZIP
goto ZIPFILE
::goto wantsomezip

:wantsomezip
echo Would you like to Zip %DDMMYYYY% ? (y/n) (This requires having 7zip installed, (you probably already have it))
set /p fzip=

if %fzip% == y goto ZIPFILE
if %fzip% == n goto BATEND
goto wantsomezip

:BATEND
echo BATCH FILE WILL NOW CLOSE
ping localhost -n 3 >nul
exit

:ZIPFILE
::GET START TIME FOR ZIP
set ZIPSTARTTIME=%time%
set ZIPSTARTHH=%ZIPSTARTTIME:~0,2%
set ZIPSTARTMI=%ZIPSTARTTIME:~3,2%
set ZIPSTARTSS=%ZIPSTARTTIME:~6,2%
set ZIPSTARTFF=%ZIPSTARTTIME:~9,2%


cd C:\Program Files\7-Zip
7z.exe a "%desktop%\%DDMMYYYY%.7z" "%desktop%\%DDMMYYYY%\"

::GET END TIME FOR ZIP
set ZIPSTOPTIME=%time%
set ZIPENDHH=%ZIPSTOPTIME:~0,2%
set ZIPENDMI=%ZIPSTOPTIME:~3,2%
set ZIPENDSS=%ZIPSTOPTIME:~6,2%
set ZIPENDFF=%ZIPSTOPTIME:~9,2%

set /a ZIPFINALHH= %ZIPENDHH%-%ZIPSTARTHH%
set /a ZIPFINALMI= %ZIPENDMI%-%ZIPSTARTMI%
set /a ZIPFINALSS= %ZIPENDSS%-%ZIPSTARTSS%
set /a ZIPFINALFF= %ZIPENDFF%-%ZIPSTARTFF%

echo _____________________________________
echo ZIP COMPLETED IN:
echo %ZIPFINALHH% Hours
echo %ZIPFINALMI% Mins
echo %ZIPFINALSS% Secs
echo %ZIPFINALFF% MSecs

ping localhost -n 3 >nul
exit
:BULL
color 0a
TITLE EvanSki's AutoBackup V.1.1
goto SETUP


:SETUP
@Echo off
cls
echo INPUT DIRECTORY OF GAMEMAKER PROJECTS FOLDER IE:(C:\Users\YOURNAME\Documents\GameMakerStudio2\projects)
set /p projdir=

::SET THE START TIME OF THE BATCH FILE
set STARTTIME=%time%

goto BACKUP_START

:BACKUP_START
cls
echo BACKUP STARTING...
set Desktop=%CD%
set DDMMYYYY=%DATE:~7,2%_%DATE:~4,2%_%DATE:~10,4%
echo %DDMMYYYY%
md "%DDMMYYYY%"
cls
echo BACKUP FOLDER CREATED! STARTING BACKUP...
ping localhost -n 3 >nul
cd %projdir%
xcopy /s "%projdir%\*" "%DESKTOP%\%DDMMYYYY%" /i
ping localhost -n 3 >nul
goto CALCTIME

:CALCTIME
cls
:: SET STOP TIME FOR BATCH FILE
set STOPTIME=%time%

echo BACKUP COMPLETED!
echo _______________________
echo StartTime : %STARTTIME%
echo EndTime : %STOPTIME%
echo _______________________

echo .
echo .
ping localhost -n 3 >nul
::ZIP
goto ZIPFILE
::goto wantsomezip

:wantsomezip
echo Would you like to Zip %DDMMYYYY% ? (y/n) (This requires having 7zip installed, (you probably already have it))
set /p fzip=

if %fzip% == y goto ZIPFILE
if %fzip% == n goto BATEND
goto wantsomezip

:BATEND
echo BATCH FILE WILL NOW CLOSE
ping localhost -n 3 >nul
exit

:ZIPFILE
cd C:\Program Files\7-Zip
7z.exe a "%desktop%\%DDMMYYYY%.7z" "%desktop%\%DDMMYYYY%\"

echo _____________________________________
echo FILE ZIPPED!

ping localhost -n 3 >nul
exit
 
Last edited:

Coded Games

Member
No offense but I don't see any legitimate reason to use something like this over a real source control application like Git. Git takes pretty much the exact same amount of time to setup and then has so many more features. Besides backing things up, one of the greatest uses of Git is its ability to make debugging way easier since you can look back and see specifically what lines of code have been changed.
 

Evanski

Raccoon Lord
Forum Staff
Moderator
No offense but I don't see any legitimate reason to use something like this over a real source control application like Git. Git takes pretty much the exact same amount of time to setup and then has so many more features. Besides backing things up, one of the greatest uses of Git is its ability to make debugging way easier since you can look back and see specifically what lines of code have been changed.
This isnt meant to replace git or sway people not to use it, its just a small file that I hope at the very least lets more people have some form of backup instead of posting a thread about how they lost there data
 

MissingNo.

Member
Thanks for the link to this Evan. I was going to download one of those auto backup programs at some point but I think I will try this first.

I have to ask though, why does the file require a password? Not a problem just a bit strange.
 

Evanski

Raccoon Lord
Forum Staff
Moderator
Thanks for the link to this Evan. I was going to download one of those auto backup programs at some point but I think I will try this first.

I have to ask though, why does the file require a password? Not a problem just a bit strange.
Its just a gate so In case anyone messes with the file and does something stupid to there computer and starts blaming me I can point out the warnings I put there
 

Evanski

Raccoon Lord
Forum Staff
Moderator
Thanks for the link to this Evan. I was going to download one of those auto backup programs at some point but I think I will try this first.

I have to ask though, why does the file require a password? Not a problem just a bit strange.
lol so, Hope it doesn't inconvenience you now but I updated it, basically its the same one already uploaded but with some useless broken stuff cut out
 

MissingNo.

Member
Hope it doesn't inconvenience you now but I updated it
No don't worry. The password thing didn't bother me I was just curious about it. Plus we already know you are a evil mastermind hell bent on taking over the world so whats new?

I'll probably give it a try tomorrow or in the next few days. I'm winding down for the evening to go to bed soon.
 
Top