Automating Full+Differential images

User discussion and information resource forum for Image products.
tanstaafl
Posts: 36
Joined: Thu Feb 14, 2013 9:54 pm

Automating Full+Differential images

Post by tanstaafl »

Hi all,

I searched the forums but didn't find an answer to this that I could implement, so...

I have 6 licenses for the Image Suite (v2+).

Goal: Automate Windows Server Image Backups to NAS device (mapped drive)

Specifics - I want to:

1. Start new Full+Differential backup set 1x week (say Friday night at 9:00pm), saved to \%targetDir%\%DAYNAME%-%DATE%-%TIME%\

2. Do differentials 5x per day (say 10:00am, & 1/4/7/10pm), 5 days/wk (Mon-Fri), at specified times/intervals, saved to the same %targetDir% as the related full backup

3. Retain 2 days worth of differentials (so, max of 10 differentials per %targetDir% backup set)

4. Retain 4 Full+Differential backup sets (after which the oldest start rotating out/deleted)

So as a visual example, the %targetDir%, after 4 weeks of backups beginning Fri 8/2/13, %backupTarget% should look like this:

\%targetDir%\Fri-0802-2100\
...%fullBackupName%
...%diffBackupName%-0808-1000
...%diffBackupName%-0808-1300
...%diffBackupName%-0808-1600
...%diffBackupName%-0808-1900
...%diffBackupName%-0808-2200
...%diffBackupName%-0809-1000
...%diffBackupName%-0809-1300
...%diffBackupName%-0809-1600
...%diffBackupName%-0809-1900
...%diffBackupName%-0809-2200

\%targetDir%\Fri-0809-2100\
...%fullBackupName%
...%diffBackupName%-0815-1000
...%diffBackupName%-0815-1300
...%diffBackupName%-0815-1600
...%diffBackupName%-0815-1900
...%diffBackupName%-0815-2200
...%diffBackupName%-0816-1000
...%diffBackupName%-0816-1300
...%diffBackupName%-0816-1600
...%diffBackupName%-0816-1900
...%diffBackupName%-0816-2200

\%targetDir%\Fri-0816-2100\
...%fullBackupName%
...%diffBackupName%-0822-1000
...%diffBackupName%-0822-1300
...%diffBackupName%-0822-1600
...%diffBackupName%-0822-1900
...%diffBackupName%-0822-2200
...%diffBackupName%-0823-1000
...%diffBackupName%-0823-1300
...%diffBackupName%-0823-1600
...%diffBackupName%-0823-1900
...%diffBackupName%-0823-2200

\%targetDir%\Fri-0823-2100\
...%fullBackupName%
...%diffBackupName%-0829-1000
...%diffBackupName%-0829-1300
...%diffBackupName%-0829-1600
...%diffBackupName%-0829-1900
...%diffBackupName%-0829-2200
...%diffBackupName%-0830-1000
...%diffBackupName%-0830-1300
...%diffBackupName%-0830-1600
...%diffBackupName%-0830-1900
...%diffBackupName%-0830-2200

Or, if saving each backup 'set' to its own directory isn't possible, just something like this in the root %targetDir% would be ok:

\0802-2100-full.TBI
\0802_0808-1000
\0802_0808-1300
\0802_0808-1600
\0802_0808-1900
\0802_0808-2200
\0802_0809-1000
\0802_0809-1300
\0802_0809-1600
\0802_0809-1900
\0802_0809-2200
\0809-2100-full.TBI
\0809_0815-1000
\0809_0815-1300
\0809_0815-1600
\0809_0815-1900
\0809_0815-2200
\0809_0816-1000
\0809_0816-1300
\0809_0816-1600
\0809_0816-1900
\0809_0816-2200
\0816-2100-full.TBI
\0816_0822-1000
\0816_0822-1300
\0816_0822-1600
\0816_0822-1900
\0816_0822-2200
\0816_0823-1000
\0816_0823-1300
\0816_0823-1600
\0816_0823-1900
\0816_0823-2200
\0823-2100.TBI
\0823_0829-1000
\0823_0829-1300
\0823_0829-1600
\0823_0829-1900
\0823_0829-2200
\0823_0830-1000
\0823_0830-1300
\0823_0830-1600
\0823_0830-1900
\0823_0830-2200

After which, the oldest Full+Diffs (or oldest directory+contents (\%targetDir%\Fri-%DATE%-%TIME%\)) would be deleted when the next full backup cycle starts.

Is this even possible?

Pointers to documentation on how to do this will be fine.

Thanks!
TeraByte Support
Posts: 3627
Joined: Thu May 05, 2011 10:37 pm

Re: Automating Full+Differential images

Post by TeraByte Support »

You could start with the sample batch script 2 at
http://www.terabyteunlimited.com/downloads-image-for-windows.htm and modify
it to handle the different directories you want it to use and to delete the
files you want it to delete - or it actually be be close enough to what you
want, just use it and do a minor adjustment if you want to reduce the
differentials.

You can also create a TBScript based script which gives you a lot more
control in a more programming like language than batch files.


"tanstaafl" wrote in message news:6070@public.image...

Hi all,

I searched the forums but didn't find an answer to this that I could
implement, so...

I have 6 licenses for the Image Suite (v2+).

Goal: Automate Windows Server Image Backups to NAS device (mapped drive)

Specifics - I want to:

1. Start new Full+Differential backup set 1x week (say Friday night at
9:00pm), saved to \%targetDir%\%DAYNAME%-%DATE%-%TIME%\

2. Do differentials 5x per day (say 10:00am, & 1/4/7/10pm), 5 days/wk
(Mon-Fri), at specified times/intervals, saved to the same %targetDir% as
the related full backup

3. Retain 2 days worth of differentials (so, max of 10 differentials per
%targetDir% backup set)

4. Retain 4 Full+Differential backup sets (after which the oldest start
rotating out/deleted)

So as a visual example, the %targetDir%, after 4 weeks of backups beginning
Fri 8/2/13, %backupTarget% should look like this:

\%targetDir%\Fri-0802-2100\
....%fullBackupName%
....%diffBackupName%-0808-1000
....%diffBackupName%-0808-1300
....%diffBackupName%-0808-1600
....%diffBackupName%-0808-1900
....%diffBackupName%-0808-2200
....%diffBackupName%-0809-1000
....%diffBackupName%-0809-1300
....%diffBackupName%-0809-1600
....%diffBackupName%-0809-1900
....%diffBackupName%-0809-2200

\%targetDir%\Fri-0809-2100\
....%fullBackupName%
....%diffBackupName%-0815-1000
....%diffBackupName%-0815-1300
....%diffBackupName%-0815-1600
....%diffBackupName%-0815-1900
....%diffBackupName%-0815-2200
....%diffBackupName%-0816-1000
....%diffBackupName%-0816-1300
....%diffBackupName%-0816-1600
....%diffBackupName%-0816-1900
....%diffBackupName%-0816-2200

\%targetDir%\Fri-0816-2100\
....%fullBackupName%
....%diffBackupName%-0822-1000
....%diffBackupName%-0822-1300
....%diffBackupName%-0822-1600
....%diffBackupName%-0822-1900
....%diffBackupName%-0822-2200
....%diffBackupName%-0823-1000
....%diffBackupName%-0823-1300
....%diffBackupName%-0823-1600
....%diffBackupName%-0823-1900
....%diffBackupName%-0823-2200

\%targetDir%\Fri-0823-2100\
....%fullBackupName%
....%diffBackupName%-0829-1000
....%diffBackupName%-0829-1300
....%diffBackupName%-0829-1600
....%diffBackupName%-0829-1900
....%diffBackupName%-0829-2200
....%diffBackupName%-0830-1000
....%diffBackupName%-0830-1300
....%diffBackupName%-0830-1600
....%diffBackupName%-0830-1900
....%diffBackupName%-0830-2200

Or, if saving each backup 'set' to its own directory isn't possible, just
something like this in the root %targetDir% would be ok:

\0802-2100-full.TBI
\0802_0808-1000
\0802_0808-1300
\0802_0808-1600
\0802_0808-1900
\0802_0808-2200
\0802_0809-1000
\0802_0809-1300
\0802_0809-1600
\0802_0809-1900
\0802_0809-2200
\0809-2100-full.TBI
\0809_0815-1000
\0809_0815-1300
\0809_0815-1600
\0809_0815-1900
\0809_0815-2200
\0809_0816-1000
\0809_0816-1300
\0809_0816-1600
\0809_0816-1900
\0809_0816-2200
\0816-2100-full.TBI
\0816_0822-1000
\0816_0822-1300
\0816_0822-1600
\0816_0822-1900
\0816_0822-2200
\0816_0823-1000
\0816_0823-1300
\0816_0823-1600
\0816_0823-1900
\0816_0823-2200
\0823-2100.TBI
\0823_0829-1000
\0823_0829-1300
\0823_0829-1600
\0823_0829-1900
\0823_0829-2200
\0823_0830-1000
\0823_0830-1300
\0823_0830-1600
\0823_0830-1900
\0823_0830-2200

After which, the oldest Full+Diffs (or oldest directory+contents
(\%targetDir%\Fri-%DATE%-%TIME%\)) would be deleted when the next full
backup cycle starts.

Is this even possible?

Pointers to documentation on how to do this will be fine.

Thanks!

tanstaafl
Posts: 36
Joined: Thu Feb 14, 2013 9:54 pm

Re: Automating Full+Differential images

Post by tanstaafl »

TeraByte Support wrote:
> You could start with the sample batch script 2 at
> http://www.terabyteunlimited.com/downlo ... indows.htm and modify

Hello again,

I'm working on implementing this now and had a few questions about modifications to the IFWRotate.cmd batch file...

1. I assume I can rename this .cmd file to whatever I want?

2. Where are all of the potential commandline options fully documented?

ie, for the TBIParms variable, what is the initial /b option for?

3. When the script runs, does it default to using the 64bit version on 64bit systems?

Also - is there any reason NOT to use the 64bit version of IFW on 64bit systems (asked another way, why does it install both versions)?

4. TBILogin variable comments says if it is used the script must be run with Administrative privileges

I always create and use a 'backups' user account for doing backups. It does not have Domain Admin privileges, but it does have full read/write privileges for the target network share.

So... I can specify the 'backups' user+passwd in this variable, but when actually scheduling the script to run, I must run it using an account with Domain Admin privileges?

5. Running unattended on Windows Servers

The readme and PDF doc files never mention Windows Server at all - why is this?

Since Servers are generally running all the time without anyone logged in, is the warning about avoiding UAC prompts something that I will have to address?

Note: I will be happy to incorporate the answers to my questions back into the comments of the script to maybe save others a little time...

Thanks!
tanstaafl
Posts: 36
Joined: Thu Feb 14, 2013 9:54 pm

Re: Automating Full+Differential images

Post by tanstaafl »

tanstaafl wrote:
> 4. TBILogin variable comments says if it is used the script must be run with
> Administrative privileges
>
> I always create and use a 'backups' user account for doing backups. It does not have
> Domain Admin privileges, but it does have full read/write privileges for the target
> network share.
>
> So... I can specify the 'backups' user+passwd in this variable, but when actually
> scheduling the script to run, I must run it using an account with Domain Admin
> privileges?

Well, this isn't working as expected.

When I try to run this script manually, I get an 'Invalid parameter' error, with a reference something to do with the username+password - and the password does not appear to be anything like the specified password.

I always use strong passwords - are there any problems with 'special characters' that could be causing this?

ie, this password contains some of these characters (interspersed with other alpha-numeric characters):

#%!$@
tanstaafl
Posts: 36
Joined: Thu Feb 14, 2013 9:54 pm

Re: Automating Full+Differential images

Post by tanstaafl »

Also,

I have a system that has partitions, so I have created a batch file to image the C partition. Server 2008 R2 creates that stupid 'System Reserve' 100MB partition, and so when backing up the C drive, I also am backing up this Reserve partition, so TBIParms is set to:

/d:w0@0x1,0x2

Now I want to create another batch file to then Image the D: (data) partition, but when examining the command that IFW wants to use (when manually running an Image job), the command looks like:

/d:w1

without the @0x1

So, for the script, do I just use '/d:w1', or would I use '/d:w1@0x1'?

Thanks
TeraByte Support(PP)
Posts: 1646
Joined: Fri Aug 12, 2011 12:51 am

Re: Automating Full+Differential images

Post by TeraByte Support(PP) »

tanstaafl wrote:
> I'm working on implementing this now and had a few questions about modifications to
> the IFWRotate.cmd batch file...
>
> 1. I assume I can rename this .cmd file to whatever I want?
You can rename the script file.

> 2. Where are all of the potential commandline options fully documented?
> ie, for the TBIParms variable, what is the initial /b option for?
These are the backup parameters supported by Image for Windows. You can find them in the Image for Windows manual: "Image for Windows Backup Options" in the "Running Image for Windows from the Command Line" section.

/b = tell Image for Windows to perform a backup

> 3. When the script runs, does it default to using the 64bit version on 64bit systems?
Currently, no. You can change it to use imagew64.exe (search for "imagew.exe" and change to "imagew64.exe").

> Also - is there any reason NOT to use the 64bit version of IFW on 64bit systems
> (asked another way, why does it install both versions)?
There shouldn't be a problem using the 64-bit version. It may be required on some 64-bit systems (such as Windows 8). On many 64-bit systems either version will work fine.

> 4. TBILogin variable comments says if it is used the script must be run with
> Administrative privileges
>
> I always create and use a 'backups' user account for doing backups. It does not have
> Domain Admin privileges, but it does have full read/write privileges for the target
> network share.
>
> So... I can specify the 'backups' user+passwd in this variable, but when actually
> scheduling the script to run, I must run it using an account with Domain Admin
> privileges?
If Image for Windows is able to correctly access the share and the script is able to count the backups then you should be okay. The problem with the script needing administrative privileges is because it uses Image for Windows to log into the share. Image for Windows will log in elevated. If the script isn't also elevated it won't have access to the share and won't be able to count the backups (it will always create full images).

> 5. Running unattended on Windows Servers
> The readme and PDF doc files never mention Windows Server at all - why is this?
As far as I'm aware, the script and Image for Windows should work fine on Windows Server.

> Since Servers are generally running all the time without anyone logged in, is the
> warning about avoiding UAC prompts something that I will have to address?
If the UAC prompt would normally be displayed and the task is configured with the correct privileges you won't see any prompt. If the prompt wouldn't or couldn't be displayed I assume it would fail. You should be able to check the IFW.LOG file and verify if the backup was created correctly.

------------

> are there any problems with 'special characters' that could be causing this?
> ie, this password contains some of these characters (interspersed with other
> alpha-numeric characters): #%!$@
Special characters may cause problems in the script. ! is used for delayed expansion of variables, for example. Can you run a test with a simple password (or no password) to verify that's the issue?

You may want to have Image for Windows save the password so you don't have to specify it in the script (see the /login option).

------------

> So, for the script, do I just use '/d:w1', or would I use '/d:w1@0x1'?
"/d:w1" specifies the entire disk. "/d:w1@0x1" specifies partition ID 1 on disk 1. Both would back up the partition. If it's the only partition on the drive I'd just go with "/d:w1" to get the entire drive.

For the C: partition drive, if it contains only the System Reserved partition and the Windows partition you could also use "/d:w0" for it instead of specifying both partitions ("/d:w0@0x1,0x2").
tanstaafl
Posts: 36
Joined: Thu Feb 14, 2013 9:54 pm

Re: Automating Full+Differential images

Post by tanstaafl »

Thanks VERY much TeraByte...

I'm almost there now...

TeraByte Support(PP) wrote:
> You may want to have Image for Windows save the password so you don't have to specify
> it in the script (see the /login option).

Yes, that was what I was missing... this solved the password problem, and others too...

One more question about running multiple scripts (ie, to backup first the C: then the D: on a system)...

What is the best way to do this such that the second script doesn't run until the first one completes?

I imagine it is to run them both from one script, but how to test for successful completion?

Is there a model/example script (like the most excellent Rotation script on your website) I could use?

Thanks again! I don't know why I waited so long to get this working...
TeraByte Support(PP)
Posts: 1646
Joined: Fri Aug 12, 2011 12:51 am

Re: Automating Full+Differential images

Post by TeraByte Support(PP) »

I just run them from a main script (usually with a short delay between):
@echo off
backupscript1.cmd
backupscript2.cmd

For testing/checking for successful completion you could edit the scripts to output/save the code and check it in the main script. Emailing the log might also work depending on your setup.
tanstaafl
Posts: 36
Joined: Thu Feb 14, 2013 9:54 pm

Re: Automating Full+Differential images

Post by tanstaafl »

TeraByte Support(PP) wrote:
> I just run them from a main script (usually with a short delay between):
> @echo off
> backupscript1.cmd
> backupscript2.cmd
>
> For testing/checking for successful completion you could edit the scripts
> to output/save the code and check it in the main script. Emailing the log
> might also work depending on your setup.

Yeah, that's what I'd like, but I honestly don't know how to do that (test for success, email the logs, etc)...

Actually, I would very much like to get emails letting me know success/failure status of each job... is that possible now?
TeraByte Support(PP)
Posts: 1646
Joined: Fri Aug 12, 2011 12:51 am

Re: Automating Full+Differential images

Post by TeraByte Support(PP) »

You can send emails using the /email parameter or by setting the options in Settings.
Post Reply