:: BackMix – BOS Folder mixing utility
::
:: This utility will mix a list of folders so BOS will
:: execute the backup procedure in different order
:: each time it runs.
::
:: To use this procedure just copy it to any folder
:: and run it manually once.
:: In BOS Session set a "Run After" command
:: with the newly created file - run.cmd
::
:: Copyright (C) 2008 Chief Applications Israel Ltd.
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Setting Variables
Set /A count=0
:: Setting BOS Folder
Set bosdir=%ProgramFiles%\BOS - Backup prOxy Server\Remote\
:::::::::::::::::::: Please Edit ::::::::::::::::::::
:: Setting source dir - With closing \ !!!Please edit!!!
Set SourceDir=C:\
:: Setting Session Name - Existin BOS Session !!!Please edit!!!
Set Sesname=newses
:::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Starting
If %1.==. Goto OD
Goto %1
Goto Stop
::
:: Setting sort by Date
:OD
Dir %SourceDir% /AD /B /OD > Dir.txt
Echo BackMix.cmd O-D > Run.cmd
Goto End
::
:: Setting sort by Reverse Date
:O-D
Dir %SourceDir% /AD /B /O-D > Dir.txt
Echo BackMix.cmd ON > Run.cmd
Goto End
::
:: Setting sort by name
:ON
Dir %SourceDir% /AD /B /ON > Dir.txt
Echo BackMix.cmd O-N > Run.cmd
Goto End
::
:: Setting sort by Reverse name
:O-N
Dir %SourceDir% /AD /B /O-N > Dir.txt
Echo BackMix.cmd OD > Run.cmd
::
:End
:: Creating Session File
Echo Session=%Sesname% > Newses.ses
:: Getting Folder list
For /F "usebackq delims=" %%a In (Dir.txt) Do Call :Work %%a
:: Finalizing Session File
Echo Items Number=%Count% >> Newses.ses
:: Activating Session File
Copy /Y Newses.ses "%bosdir%Newses.ses"
:Stop
Goto :EOF
Exit
:Work
:: Setting counter
Set /A count+=1
:: Appending Line to session file
Echo Item%count%=%SourceDir%%1\*.* >> Newses.ses