hi this is a small project I am working on that will backup my internet favorite to a folder and also add to a log so I know when it was backed up. it very basic at the moment and is made in just windows batch file.
if you think of anything I can add let me know I whould like ideas.
Code:
@ECHO OFF
REM Backup script by Ben
REM LAST MOD 00:30 28/01/2016
set BASEROOT=C:\BACKUP\MyBookmarks
Set BACKUPNAME=set_%RANDOM%\0001
Set SOURCEFOLDER=%USERPROFILE%\Favorites
Set BACKUPFOLDER=%BASEROOT%\%BACKUPNAME%
TITLE BACKUP
ECHO +---------------------------------+
ECHO + My Favorites Backup Helper +
ECHO +---------------------------------+
ECHO.
ECHO This batch file will back up your internet bookmakers.
ECHO.
PAUSE
CLS
REM Check that backup folder is here
IF NOT EXIST %BACKUPFOLDER% GOTO MAKEDIR
REM The main files copy
:COPYFILES
XCOPY %SOURCEFOLDER% %BACKUPFOLDER% /c /d /e /h /i /k /q /r /s /x /y
CLS
ECHO +--------------------------------+
Echo + All files have been backed up. +
ECHO +--------------------------------+
PAUSE
REM Write to log
ECHO %DATE% %TIME% %BACKUPFOLDER% >> %BASEROOT%\LOG.TXT
REM open the new folder.
START %BASEROOT%
EXIT
REM Make backup folder
:MAKEDIR
MKDIR %BACKUPFOLDER%
GOTO COPYFILES