Link to home
Start Free TrialLog in
Avatar of ccfcfc
ccfcfcFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Symantec Backup Exec help needed

I have a restore job scheduled to run every night that will restore from a specific backup set created at a specific date and time i.e. filebackup.bkf created on 14/11/2012 at 19:00 - filebackup.

Is there a way to schedule the restore so that backup exec will restore back a copy of a file that is called filebackup.bkf regardless of when the backup set was created? I see that you can schedule both inventory and catalog actions every night but cant see how to say to backup exec to restore back the bkf file in the directory when the file itself will be refreshed each night. The name of the file wont change, but the contents will be.

Any help would be greatly appreciated
Avatar of denbosse
Flag of Ireland image

You could try to use bemcmd.exe - the command line version of Backup Exec.
See Page 177 in the PDF shows how you can specify parameters for the selection of a restore job. I've not tried it myself, but imagine that a combination of JOBHISTORY_GUID, START_DATE and END_DATE may work. Or if you know the path of the actual files to be restored, I can imagine that SELECTIONx in combination with the dates may be easier than JOBHISTORY_GUID.

See page 127 for info on job script files and page 162 for the start of the restore job script file parameters.
Avatar of ccfcfc


hi Denbose
Just having a look at the script and the PDF now, I know the path of where the files are to be restored from and where they need to end up, think its the media set or media ID that will be changing and its that change that I need the script to reflect...if that makes sense
I had another quick look through the PDF. I don't see where you need to specify media id or media set when doing the restore job - but I could be wrong.
I'm thinking that if you specify the path and date range in such a way that only one backup set corresponds to those criteria, then Backup Exec may know to pick the only corresponding & correct piece of media. Again, not tested it myself.

The selections file may look something like this:

JOB_NAME=Test Restore


The way to launch it would be something like this:

bemcmd.exe -o90 -fc:\selectionfile.txt
Avatar of ccfcfc


will give that a go in a second, thank you for your help, scripting really isnt my area so it means a lot. The media ID etc that I mentioned I think I got confused with whether I needed the jobhistory GUID or the job instance GUID.
Am i right in thinking that if I only have the one bkf file in the directory then I can broaden the start/finish date ?

Thanks again
David Thomas
You may be right - yes. If you overwrite the one bkf file every day, then any older references to the backed up file would have been removed from the Backup Exec catalog.
Just make sure there are no other backups from other backup jobs that have the same backed up file in them.
Avatar of ccfcfc


no, the idea is to have the one singular file named backup.bkf in that directory that gets overwritten on a nightly basis (file copy from another server) then have a scheduled job to restore those files to a location on the local server.
Ah - if the file is copied from another server, you will have to run an inventory and catalog job before doing the restore.
Avatar of ccfcfc


ok, thought that might be the case, have set up a scheduled job to do the inventory and catalog the directory so waiting to make sure that that works and will try the script  entries that you mentioned after that. I assume I only need the entries you mentioned and not all the other parts unless I need to change security or directory structures on the restore ?

Thanks very much for your help, I really do appreciate it.
If it's a restore from another server, you may have to redirect the restore, especially if the original server the data was backed up from can be reached from the server you're restoring from. Otherwise you may restore the data to the original server.
SHARE_REDIRECT_PATH and SHARE_REDIRECT_DRIVE seem to be the parameters.

Test it, but be careful.
Avatar of ccfcfc


thanks very much for that, have got the server in question segregated so it thinks it is restoring back to the original location but isnt LOL so that shouldnt be an issue but thanks for the heads up.
Avatar of ccfcfc


Trying to run the command you kindly suggested and I get an error of:

"missing or invalid command line switch '-f'
Return value -1"

Any idea's ? I tried putting a gap between the -f and the file name but still get the same error, if I use:

bemcmd.exe -o90 -f"c:\selectionfile.txt"

Then I dont get an error, just a return value of -1 but nothing runs LOL so guessing thats not right either.
It should be the second format, but obviously it doesn't complete.
What is the contents of c:\selectionfile.txt?
Avatar of ccfcfc


Morning Denbosse
Contents of the file are pasted below. Went with the sample script and added/changed the parts you suggested previously, hope that was correct.

/* operations: 90 */



/* If JOB_NAME is not given, one will be automatically generated. */
JOB_NAME=Test Restore

/* The SERVER, USERNAME, and PASSWORD values are used to connect to a remote server. */


/*General Restore*/




/*File Redirection*/


/*SQL Redirection*/


/*Exchange Redirection*/


/*Sharepoint Redirection*/

//SP_REDIRECT_SERVER=server name
//SP_REDIRECT_WORKGROUP=workspace name



/*Pre-Post Command*/



/* The value for COMMAND_AUTO_CANCEL_TIME is given as minutes. */

/* A value of 0 for COMMAND_RUN_OPTION will run the command on the local media server. A value of 1 will run on each server

being backed up. */
//COMMAND_RUN_OPTION=0/1 (0 to run the command on this media server and 1 to run on each server being backed up)


//SQL_LOGMARK_NAME=named transaction



/*Exchange 5.5*/


/*Exchange 2000*/



//LOTUS_WAIT_MSECS=x where x is the number of seconds. x can take any value e.g. 35

/*Netware SMS*/





/*NOTE: Bemcmd -o90 restores require the Job History GUID.  To obtain the Job History GUID, you will need to     */
/*      obtain the Job Instance GUID for your backup job.  You can obtain the Job Instance GUID with bemcmd -o12 */
/*      and/or -o506, then use the Job Instance GUID with bemcmd -o21 to obtain the Job History GUID.            */






/* SCHED_REPEAT_INTERVAL is the Day Interval and is given as number of days. */

/* SCHED_ANCHOR is the day from which to calculate the Day Interval. */

/* SCHED_DAYSOFMONTH should be given in a comma delimited form.  Each value should be between 1-32, 32 signifying the last day

of the month. */

/* SCHED_DAYSOFWEEK should be given as comma delimited pairs of day/week. The range for the days are 1 to 7 where Sunday=1,

Monday=2, etc. The range for the weeks are 1 to 5. */

/* SCHED_INCLUDEDATEx is used to include a specific date. Any number of specific dates can be given, e.g. SCHED_INCLUDEDATE1,


/* SCHED_EXCLUDEDATEx is used to exclude a specific date. Any number of exclude dates can be given, e.g. SCHED_EXCLUDEDATE1,


/* If none of the SCHED_ values are given then DATE and TIME will be used to set the "Run On" value. */

/* If RUN_IMMEDIATE=YES then DATE, TIME and SCHED_ values should not be specified. */

/* The AUTO_CANCEL_TIME value is in number of minutes. To specify hours, make divisible by 60. */

Sorry - didn't have much time to look at this.
One thing I notice is SELECTION1=\\intamac-01\c\backup\Backup.bkf

That probably needs to be the path to a file you're restoring.

So instead of c\backup\backup.bkf, try specifying one of the files you want to restore in the SELECTION1 section. Start by specifying one file. If that works, you should probably be able to expand it to wildcards.

Before you execute the command, you should also start sgmon.exe from the Backup Exec folder. Select all options and leave it running. The log  (in the logs subfolder) may give an indication about the -1 return status if it still happens.
Avatar of ccfcfc


Thank you very much for having a look at this, I really appreciate it. The path that I have shown above is the main file I want to restore, does this have to be actual files, i.e. doc1.txt, doc2.doc etc rather than specifying the backup set i.e. backup.bkf ?

Also, wanted to ask if the path had to be done in the UNC format or whether I should be using c:\backup\backup.bkf as \\intamac-01\c\backup\backup.bkf points to a file on the local drive anyway ? wasnt sure on the syntax that BEMCMD needed ?

Will definitely try sgmon, if that can give any indications as to whats going on in the background then hopefully that will at least point me in the direction of whats going wrong.

Thanks again for your help, scruipting seems to be a minefield for me LOL.
Avatar of ccfcfc


ok, trying sgmon gives me:

Capturing to C:\Program Files\VERITAS\Backup Exec\NT\logs\SGMon.log
beserver: [4704] 11/21/12 09:39:15 -1 Client requested key.
beserver: [4704] 11/21/12 09:39:15 -1 Client 'INTAMAC-01' connected('supbackup','INTAMAC\supbackup'): 0x17ef0b8
beserver: [4704] 11/21/12 09:39:15 -1 Client 'INTAMAC-01' Disconnected:0x17ef0b8

Have tried doing a quick google search and getting no results for that "error" expanding it to look for results with "disconnected" in it just in case it relates or gives me another avenue to explore.

Thank you very much for your time
Avatar of ccfcfc


If I re-run the catalog command (manually) then the "error" message changes to:
beserver: [4704] 11/21/12 09:39:15 -1 Client requested key.
 beserver: [4704] 11/21/12 09:39:15 -1 Client 'INTAMAC-01' connected('supbackup','INTAMAC\supbackup'): 0x180ae00
 beserver: [4704] 11/21/12 09:39:15 -1 Client 'INTAMAC-01' Disconnected:0x180ae00

really dont understand it...only articles that come up on google relate to apache when searching for that error code so am completely lost now...
Avatar of denbosse
Flag of Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ccfcfc


Thank you for the -v suggestion, may have pointed me in the right direction, am using BE 10d here but have a copy of R3 I could try installing.

Tried the -v and get "error processing script file -1" so I think you may be right that it cant handle a BKF file in the script which is a real pain as another backup system creates that file which then gets copied over to where I need it. Might have to see if I can somehow just do an xcopy or equivalent of the actual files concerned and not use backup exec so that it doesnt create a BKF to start with LOL.
Avatar of ccfcfc


looks like scripting the file then it needs to have actual file names given and not using BKF files which doesnt help but hey, at least I know and will just have to do the restore manually for now. Thanks very much for the help Denbosse, I really appreciate you spending the time...