cancel
Showing results for 
Search instead for 
Did you mean: 

Backup exec 8.5 scipt

doralst
Level 3

Helo,
I have a probleme when i run a script to create full and incremental backup job (the script is "FullIncBackup.vbs")
After have run the script with the arguments i have a error.
If can you help me ? i would know the possible solutions.
(Windows XP SP3 Backup exec system recovery 8.5 )

1-
        the command line :
                D:\Documents and Settings\fdorange\Bureau>cscript.exe FullIncBackup.vbs D:\ L 15:00 3         

        Result :

                D:\Documents and Settings\fdorange\Bureau\FullIncBackup.vbs(257, 2) (null): Result (0xec8f1b61 33 VPRO_ERROR_COMMAND_FILE_NOT_FOUND Args [1] Arg(0xbab000d 111
                D:\Documents and Settings\All Users\Application Data\Symantec\Backup Exec System Recovery\CommandFiles\Post.cmd);)
      
2-
        command line :

                D:\Documents and Settings\fdorange\Bureau>cscript.exe FullIncBackup.vbs \\salpt10144\ L 15:00 3

        Result :
                D:\Documents and Settings\fdorange\Bureau\FullIncBackup.vbs(250, 2) (null): Result (0xec8f1b61 33 VPRO_ERROR_COMMAND_FILE_NOT_FOUND Args [1]      Arg(0xbab000d 110
                D:\Documents and Settings\All Users\Application Data\Symantec\Backup Exec System Recovery\CommandFiles\pre.cmd);)
1 ACCEPTED SOLUTION

Accepted Solutions

Markus_Koestler
Moderator
Moderator
   VIP   

With this script you can only do full volume backups ! As I said before to only save certain files you have to use a "file and folder" backup.
So I think this script is useless for you.
And until now I was not able to figure out how to create a script that creates a file and folder backup job.

Regarding a script that simply runs an existing backup job, I can provide you this script. It's used to run a volume backup job, so you have to adapt it to run a file and folder backup job. The script takes the computername of the target computer as only argument.


Option Explicit


    Dim v2iAuto
    Dim Computer
    Dim oCurrentJob
    Dim oImageJob

    Computer = WScript.Arguments(0)

    '
    ' Step 1: Create a LiveState Recovery automation object
    '
    Set v2iAuto = CreateObject("Symantec.ProtectorAuto")

    '
    ' Step 2: Connect to the local agent
    '
    WScript.Echo "Connecting to " & Computer &" ..."
    Call v2iAuto.Connect(Computer)

    '
    ' Step 3: Iterate over all image jobs and remove each one
    '
    Set oImageJob = CreateObject("Symantec.VProRecovery.ImageJob")

    For Each oCurrentJob in v2iAuto.ImageJobs
        Call V2iAuto.DoImageJob(oCurrentJob.ID,oImageJob.Constants.ImageTypeFull)



    Next


View solution in original post

20 REPLIES 20

Markus_Koestler
Moderator
Moderator
   VIP   
The script expects a batch file called pre.cmd in the directory D:\Documents and Settings\All Users\Application Data\Symantec\Backup Exec System Recovery\CommandFiles. This file is run BEFORE the data is captured. This is the reason for the error.

doralst
Level 3

Ok , but i haven't the file in the folder and i throught the file was create by the script :

    Set oCommandFilePre = CreateObject("Symantec.VProRecovery.CommandFile")
    oCommandFilePre.Name = "pre.cmd"
    oCommandFilePre.FileName = "pre.cmd"
    oCommandFilePre.Folder = objPath  & "\Application Data\Symantec\Backup Exec System Recovery\CommandFiles"
    oCommandFilePre.Timeout = 1200
    Call oCommandFilePre.Validate() ' Make sure we built the task correctly

If the script don't create the pre.cmd else where find it ?

Markus_Koestler
Moderator
Moderator
   VIP   
You have to create it by yourself. Just open Notepad and save it as pre.cmd.

doralst
Level 3


Thanks this was the problem .
If can you help me ?
Now, I have a new problem :
 D:\Documents and Settings\fdorange\Bureau\FullIncBackup.vbs(266, 2) Erreur d'exé
 cution Microso...

 

Markus_Koestler
Moderator
Moderator
   VIP   

Have you noticed that you also need the files post.cmd and after.cmd in this directory ?
Regarding this error message: How many volumes does the server you want to backup have ?

doralst
Level 3
Yes, I have add the files post and after.cmd in the directory .
In my server i have a volume of 151 GB and i have two disk of 30GB of use volume.
so i have the necessary place in my server .

Markus_Koestler
Moderator
Moderator
   VIP   

Seems a little odd to me since line 266 where it says there is an error, there is no reason for an index out of range error. Can you confirm, that in the script you use line 266  contains the following:

    oImageJob.IncrementalSupport = true


doralst
Level 3

Yes he have this line in my script but he is just befor the line 266.
it is line 262 .

Markus_Koestler
Moderator
Moderator
   VIP   

So the line that causes the error is

Set oImageJob = CreateObject("Symantec.VProRecovery.ImageJob")

?

doralst
Level 3

In my script this line is the 258 and the line 266 is :

If (WScript.Arguments(4) = "DISK") Then

I put my script in "file attachement"

Markus_Koestler
Moderator
Moderator
   VIP   

If I get you right, this line causes the error:

If (WScript.Arguments(4) = "DISK") Then

So It seems there is this argument missing. I also noticed that this information is also missing in the help of the utility.

Please run the script with you parameters AND add NAS as an additional argument e.g:

cscript FullIncBackup.vbs \\SERVER\SHARE N 23:00 0 NAS

and let me know how it goes.

doralst
Level 3

With your command line we have a new error :

D:\Documents and Settings\All Users\Bureau\FullIncBackup.vbs(298, 2) (null): Res
ult (0xec8f17ba 33 VPRO_ERROR_VOLUME_ALREADY_TRACKED Args [2] Arg (0xbab000d 3 C
:\) Arg (0xbab000d 3 123);)

I am supris because the argument is the 4 and i thought it corresponded at network (N) ...

Markus_Koestler
Moderator
Moderator
   VIP   

This error means that there is already a backup job that protects this volume. YOu habe to delete this other job.
No the arguments start counting at 0 so 4 is the 5th argument.

doralst
Level 3
Thanks for your help !! 

now, I have a error when it does the backup... and he schedule for all days on the futur years   ... 

It's good, the script run but i don't create many scheduling, i must delete the other files   is it possible of create more ?

It's possible, i would like exlude the files (exemple i want not save document and setings) why do i do ? what do i change  in the script ?

doralst
Level 3
If possible, can we delete the selection of hours and date (i use ALTIRIS for schedule the action ) and run when the script is run ?

Markus_Koestler
Moderator
Moderator
   VIP   

Sorry but I don't undstand what you mean with "


now, I have a error when it does the backup... and he schedule for all days on the futur years   ... 

It's good, the script run but i don't create many scheduling, i must delete the other files   is it possible of create more ?"

Regarding the exclusion of files: The script creates a volume based image job, with which you can not exclude any files or folders. This can only be done using a "file and folder" backup.

Regarding the selection of hours: Yes do that the job will be listed with no schedule:
Just comment out the following lines:
'oImageJob.Task = oTask
'oImageJob.IncrementalTask = oiTask

doralst
Level 3
My objectiv with this script is :
       - I must do a save of some files when the sript is run.
       - the backup must start as soon as the script is running
      
I use altiris for scheduling
the script must just run a backup. I don't need wich the script does a scheduling the backup  ( Altiris that allows to do )

je dois modifier le script afin qu'il n'y ai pas d argument


(And sorry, I don't speak very good English )

doralst
Level 3

when i comment this lines, the  script to work properly but there are not executing  of backup ...

Markus_Koestler
Moderator
Moderator
   VIP   

With this script you can only do full volume backups ! As I said before to only save certain files you have to use a "file and folder" backup.
So I think this script is useless for you.
And until now I was not able to figure out how to create a script that creates a file and folder backup job.

Regarding a script that simply runs an existing backup job, I can provide you this script. It's used to run a volume backup job, so you have to adapt it to run a file and folder backup job. The script takes the computername of the target computer as only argument.


Option Explicit


    Dim v2iAuto
    Dim Computer
    Dim oCurrentJob
    Dim oImageJob

    Computer = WScript.Arguments(0)

    '
    ' Step 1: Create a LiveState Recovery automation object
    '
    Set v2iAuto = CreateObject("Symantec.ProtectorAuto")

    '
    ' Step 2: Connect to the local agent
    '
    WScript.Echo "Connecting to " & Computer &" ..."
    Call v2iAuto.Connect(Computer)

    '
    ' Step 3: Iterate over all image jobs and remove each one
    '
    Set oImageJob = CreateObject("Symantec.VProRecovery.ImageJob")

    For Each oCurrentJob in v2iAuto.ImageJobs
        Call V2iAuto.DoImageJob(oCurrentJob.ID,oImageJob.Constants.ImageTypeFull)



    Next