Scripting in Bash Windows

Simple Windows Backup Using Robocopy

This is a simple backup script for Windows Servers, this script can use network shares or local paths however for this example we have used local paths. In this example the data that we want to backup is on A:AGIX and the directory that we want to store it on is B:Backup. The script will create a log file in a public share location so that you check your backups completed successfully, these logs will be dated in dd/mm/yyyy format.

@ECHO OFF
rem Backs up anything in the AGIX folder on the A: Drive and Creates a log in Public_Share
ECHO %Date%
robocopy "A:AGIX" "B:Backups" /e /eta /log+:B:Public_ShareBackup_LogsBackup%date:~4,2%-%date:~7,2%-%date:~10%.log
ECHO Done
rem pause

The log will have details of the amount of files copied, the percentage of each file copied (So you can see how long you have to wait if your backup does not complete on time)