Friday, November 28, 2014

Automatic Daily Backup

Create an automatic daily backup to flash drive or to external hard drive

1. Download and install 7-Zip free file archiver

2. Create batch file - open Notepad, click and drag your mouse to select
the code below
----------

@ECHO OFF
SET hr=%time:~0,2%
IF %hr% lss 10 SET hr=0%hr:~1,1%

Set TODAY=%date:~7,2%

ECHO.

ECHO Compressing files...
ECHO.
"C:\Program Files\7-Zip\7z.exe" a -t7z "F:\%TODAY%.7z" "C:\Folder\*" -mx5
ECHO.

exit

----------

3.Paste copied text into Notepad and save as dailybackup.bat on desired
location on your pc hard drive

as sample you can save file as:

C:\dailybackup.bat


4. Find, copy and change a 7-Zip 7z.exe file path IF path on your pc
different from this:

C:\Program Files\7-Zip\7z.exe


5. C:\Folder\* - is folder name that you want to back up - change to
desired folder name (* means all files and directories inside this folder)

6. F:\%TODAY%.7z - F: - is your flash drive or external hard drive
letter - change to desired drive name

7. Schedule a task in windows to run batch file once a day using Windows
task scheduler

Voila!

Now you will have daily backups automatically - every backup name will
have day of month number and have extension .7z

No comments:

Post a Comment