Direkt zum Inhalt

Auto-generating a DATE folder for image. (VERSIONING?!)

Thread needs solution

I searched a lot and I couldn’t find a solution .

Standard scenario:
Image of c:\ ---> is created on d:\image.tibb

THE problem.
I want every image to be created in a different DATE folder that is generated by acronis.

Like this:
Image of c:\ ---> is created on d:\02.04.2010\image.tibb
Next day it will be created in :
Image of c:\ ---> is created on d:\03.04.2010\image.tibb
Next day it will be created in :
Image of c:\ ---> is created on d:\04.04.2010\image.tibb

etc ...

Anyone?

Thanks!!!
K

0 Users found this helpful

There may be an easier way but the first thing that comes to mind to use a script such as this (see below)
test the script manually to confirm it works as expected in your local date/time convention/format.

All you then need to define a job with two key qualities.
1) the job must call this script as a pretask.
2) the job must write its output file to the root of drive "M:\"

Through the magic of this script - drive "m:" will actually be a folder on another drive.
That folder will be dynamically created/defined at runtime.

:: Make_timestamp_folder.bat
::
:: this script parses/extracts key elements from variables %date% and %time%
:: it then creates a folder on of that timestamped name on drive K:
:: this script then maps drive "M:" to be this folder.
:: any process that writes to drive "M:" will in fact be writing this folder on drive "K"
::
:: FYI: the format of %date%" and "%time%" vary by region one may need to adjust
:: the hard coded parsing to match the local region date/time formats
:: this code is based on a "echo %date%" returning data in the form of mm/dd/yy
:: and "echo %time" returning data in the form "hh24:mi:ss.cc"
::
set folder_name=ATI_20%date:~6,2%_%date:~0,2%_%date:~3,2%_%time:~0,2%_%time:~3,2%_%time:~6,2%
echo %folder_name%
K:
mkdir %folder_name%
subst m: /d
subst m: %folder_name%

Thanks for your explenation.

Maybe I am doing something wrong, but it wont create folders on network drive.

Admin
Exact path:
image from c:\ --->>> to \\backup-nas2\Image
The job is sheduled task.
No user interference available.

Thank you.

Is your NAS set up as a mapped drive letter or using UNC?

Acronis products tend to prefer UNC entries.

OracleDBA will know more than I, but I wonder if you need a 'setlocal' command to access the NAS

yup the CD command does not support UNC paths you'll have to change the script to use pushd instead...

set folder_name=ATI_20%date:~6,2%_%date:~0,2%_%date:~3,2%_%time:~0,2%_%time:~3,2%_%time:~6,2%
echo %folder_name%
pushd "\\server\folder1\folder2\folder3\"
mkdir %folder_name%
subst m: /d
subst m: "\\server\folder1\folder2\folder3\%folder_name%"