7zip Backup Script

10 May 2015

Here is a simple batch script to backup my project folder every 18:30. I wish I could run this in cron but my development machine is running Windows.

@SETLOCAL
@ECHO OFF

@REM ----- begin backup ------------------------------------------------
@REM path is handled by mklink done initially
@REM SET reads whitespaces too!

SET file=workspace.7z
SET source=C:\Users\dhonnee.manalo\git\workspace\

@REM ----- 7za merges with old archive
@REM ----- workaround is to delete first

7za a -t7z %file% %source%

ECHO Compression finished!
@REM ----- end backup --------------------------------------------------

@REM ----- copy to x:drive ---------------------------------------------

SET destination=\\remote_server\dev\dhon.manalo\workspace\

copy %file% %destination% /Y

ECHO Backup finished!

@REM ------- END backup.bat ------------------