Author Topic: Backup-Manager for GLBasic :)  (Read 3621 times)

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4963
  • O Rly?
    • View Profile
Backup-Manager for GLBasic :)
« on: 2009-Jul-29 »
This is a Backup-Manager on a macro (batchfile).
It use a menu to do some stuff :D

If you use it, you have to edit a line:

SET backuppath=C:\GLB_Backups

for example:

SET backuppath=D:\MyStuff\GLB_Backups

The full MACRO:

Code: GLBasic [Select]
:: Backupmanager

@ECHO OFF

:: Set the backuppath (you can edit it!)
SET backuppath=C:\GLB_Backups

:start
CLS
ECHO Backupmanager by -Schranz0r- www.glbasic.com
ECHO.
ECHO [1] save and exit
ECHO [2] save and open backupfolder
ECHO [3] open backupfolder
ECHO [0] close
ECHO.
ECHO -------------------------------
ECHO.

set /P menu="select what you want to do: "

IF /I "%menu%" == "1" GOTO save_exit
IF /I "%menu%" == "2" GOTO save_open
IF /I "%menu%" == "3" GOTO open
IF /I "%menu%" == "0" GOTO close
IF /I "%menu%" == "" GOTO start



:: ------------------------------------------------------------------ SAVE & EXIT -
:save_exit

:: clear the screen
CLS

:: Display some stuff on the console ;)
ECHO Copy project %GLB_PROJ_NAME% to %backuppath%\%GLB_PROJ_NAME%

:: Create the directory for the backup if it not exist
IF NOT EXIST "%backuppath%\%GLB_PROJ_NAME%\" MKDIR "%backuppath%\%GLB_PROJ_NAME%\"

:: Copy the project to th backup-folder
XCOPY "
%GLB_PROJ_PATH%\*.*" "%backuppath%\%GLB_PROJ_NAME%\" /E/Y

:: wait for a keyhit
PAUSE
EXIT /B



:: ------------------------------------------------------------------- SAVE & OPEN -
:save_open

:: clear the screen
CLS

:: Display some stuff on the console ;)
ECHO Copy project %GLB_PROJ_NAME% to %backuppath%\%GLB_PROJ_NAME%

:: Create the directory for the backup if it not exist
IF NOT EXIST "
%backuppath%\%GLB_PROJ_NAME%\" MKDIR "%backuppath%\%GLB_PROJ_NAME%\"

:: Copy the project to th backup-folder
XCOPY "
%GLB_PROJ_PATH%\*.*" "%backuppath%\%GLB_PROJ_NAME%\" /E/Y

:: open the explorer and go to the backupfolder
%SystemRoot%\explorer.exe /e,%backuppath%

:: exit the batchfile (Macro)
EXIT /B


:: ------------------------------------------------------------------------- OPEN -
:open

:: clear the screen
CLS

:: open the explorer and go to the backupfolder
%SystemRoot%\explorer.exe /e,%backuppath%

:: exit the batchfile (Macro)
EXIT /B


:: ------------------------------------------------------------------------ CLOSE -
:close

CLS
EXIT /B
« Last Edit: 2009-Jul-29 by Schranz0r »
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1750
    • View Profile
    • Homepage
Re: Copy your project to a backupfolder
« Reply #1 on: 2009-Jul-29 »
Nice, if you download the latest beta from the frontpage, macro is working for english users too.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4963
  • O Rly?
    • View Profile
Re: Copy your project to a backupfolder
« Reply #2 on: 2009-Jul-29 »
Thx for the info ;)

I update the first post and add some stuff  :whistle:
« Last Edit: 2009-Jul-29 by Schranz0r »
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1578
  • Particle Hawk
    • View Profile
Re: Backup-Manager for GLBasic :)
« Reply #3 on: 2009-Oct-16 »
Thanks Schranzor,

I altered your code a little to make it work for my computer a little better.

Code: GLBasic [Select]
:: Backupmanager

@ECHO OFF

:: Set the backuppath (you can edit it!)
color 1F
md Backup
SET backuppath=%GLB_PROJ_PATH%\Backup

:start
CLS
TITLE Backupmanager For GLBasic
ECHO.
ECHO [1] save and exit
ECHO [2] save and open backupfolder
ECHO [3] open backupfolder
ECHO [0] close
ECHO.
ECHO -------------------------------
ECHO.

set /P menu="select what you want to do: "

IF /I "%menu%" == "1" GOTO save_exit
IF /I "%menu%" == "2" GOTO save_open
IF /I "%menu%" == "3" GOTO open
IF /I "%menu%" == "0" GOTO close
IF /I "%menu%" == "" GOTO start



:: ------------------------------------------------------------------ SAVE & EXIT -
:save_exit

:: clear the screen
CLS

:: Display some stuff on the console ;)
ECHO Copy project %GLB_PROJ_NAME% to %backuppath%

:: Copy the project to the backup-folder
COPY "%GLB_PROJ_PATH%\*.*" "%backuppath%"

:: wait for a keyhit
PAUSE
EXIT /B



:: ------------------------------------------------------------------- SAVE & OPEN -
:save_open

:: clear the screen
CLS

:: Display some stuff on the console ;)
ECHO Copy project %GLB_PROJ_NAME% to %backuppath%\%GLB_PROJ_NAME%

:: Copy the project to th backup-folder
COPY "%GLB_PROJ_PATH%\*.*" "%backuppath%"

:: open the explorer and go to the backupfolder
%SystemRoot%\explorer.exe /e,%backuppath%

:: exit the batchfile (Macro)
EXIT /B


:: ------------------------------------------------------------------------- OPEN -
:open

:: clear the screen
CLS

:: open the explorer and go to the backupfolder
%SystemRoot%\explorer.exe /e,%backuppath%

:: exit the batchfile (Macro)
EXIT /B


:: ------------------------------------------------------------------------ CLOSE -
:close

CLS
EXIT /B
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)