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
denbosse
Flag of Ireland image

You could try to use bemcmd.exe - the command line version of Backup Exec.
See http://www.symantec.com/docs/TECH126925. 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

ASKER

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:

[General]
JOB_TYPE=Restore
JOB_NAME=Test Restore

[Selections]
SELECTION1=\\myserver\c\temp\myfile.txt
START_DATE=11/18/2012
END_DATE=11/19/2012



The way to launch it would be something like this:

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

ASKER

hiya
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

ASKER

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

ASKER

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

ASKER

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

ASKER

hi
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

ASKER

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.

/* RESTORE SCRIPT */
/* operations: 90 */

[General]

JOB_TYPE=Restore
//JOB_PRIORITY=HIGHEST/HIGH/MEDIUM/LOW/LOWEST

/* 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. */
SERVER=intamac-01
USERNAME=supbackup
PASSWORD=<passwd>

[Restore_Options]

/*General Restore*/

RESTORE_EXISTING=1
RESTORE_CORRUPT_FILES=1
RESTORE_SECURITY=0
RESTORE_PRESERVE=0

/*Device*/

//DEVICE_NAME=backup

/*File Redirection*/

//SHARE_REDIRECT_DRIVE=C:
//SHARE_REDIRECT_PATH=directory
//SHARE_REDIRECT_SERVER_ACCOUNT={00000000-0000-0000-0000-000000000000}
//SHARE_REDIRECT_PATH_ACCOUNT={00000000-0000-0000-0000-000000000000}

/*SQL Redirection*/

//SQL_REDIRECT_SERVER=server name
//SQL_REDIRECT_INSTANCE=instance name
//SQL_REDIRECT_DATABASE=database name
//SQL_REDIRECT_SERVER_ACCOUNT={00000000-0000-0000-0000-000000000000}
//SQL_REDIRECT_ACCOUNT={00000000-0000-0000-0000-000000000000}

/*Exchange Redirection*/

//XCH_REDIRECT_SERVER=server name
//XCH_REDIRECT_MAILBOX=mailbox name
//XCH_REDIRECT_SERVER_ACCOUNT={00000000-0000-0000-0000-000000000000}
//XCH_REDIRECT_MAILBOX_ACCOUNT={00000000-0000-0000-0000-000000000000}

/*Sharepoint Redirection*/

//SP_REDIRECT_SETS_SERVER=server name
//SP_REDIRECT_DRIVE=drive
//SP_REDIRECT_PATH=path
//SP_REDIRECT_SERVER=server name
//SP_REDIRECT_WORKGROUP=workspace name
//SP_REDIRECT_SERVER_ACCOUNT={00000000-0000-0000-0000-000000000000}

/*Advanced*/

//RESTORE_RSM_DATA=0-1
//RESTORE_DISK_QUOTA=0-1
//RESTORE_TERMINAL_SERVICES=0-1
//RESTORE_WMI=0-1
//RESTORE_CLUSTER_DB=0-1
//RESTORE_FORCE_RECOVERY=0-1
//RESTORE_PRIMARY_REPLICA=0-1
//RESTORE_REGISTRY=0-1
//RESTORE_PNP_MERGE=0-1
//RESTORE_JUNCSASDIRS=0-1

/*Pre-Post Command*/

//PRE_JOB_COMMAND=command
//POST_JOB_COMMAND=command

//COMMAND_RUN_JOB_IF_PRE_SUCCESS=0-1
//COMMAND_RUN_POST_IF_PRE_SUCCESS=0-1
//COMMAND_RUN_POST_IF_JOB_FAILS=0-1
//COMMAND_FAIL_JOB_IF_FAILS=0-1

/* The value for COMMAND_AUTO_CANCEL_TIME is given as minutes. */
//COMMAND_AUTO_CANCEL_TIME=1-300

/* 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
//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*/

//SQL_DATABASE_RECOVER=0-2
//SQL_REPLACE_DATABASE=0-1
//SQL_AUTOMASTER=0-1
//SQL_POSTRESTORE_DBCC=0-3
//SQL_DEFAULT_DRIVE=C
//SQL_USE_ALLDEFAULT=0-1
//SQL_USE_DEFAULT_INSTDIR=0-1
//SQL_POINTINTIME=mm/dd/yyyy,hh:mm:ss
//SQL_LOGMARK_NAME=named transaction
//SQL_LOGMARK_INCLUDE=0-1
//SQL_LOGMARK_TIME=mm/dd/yyyy,hh:mm:ss

/*Exchange*/

//XCH_AUTOCREATE_MAILBOX=0-1

/*Exchange 5.5*/

//XCH_NOLOSS_RESTORE=0-1
//XCH_RESTORE_PUBLIC=0-1
//XCH_RESTORE_PRIVATE=0-1

/*Exchange 2000*/

//ESE_NOLOSS_RESTORE=0-1
//ESE_TEMPLOG_PATH=path
//ESE_COMMIT_AFTER=0-1
//ESE_MOUNT_AFTER=0-1
//ESE_DISMOUNT_BEFORE=0-1

/*Domino*/

//LOTUS_WAIT_MSECS=x where x is the number of seconds. x can take any value e.g. 35
//LOTUS_DBRECOVER_OPTION=0-2
//LOTUS_POINTINTIME=mm/dd/yyyy,hh:mm:ss

/*Netware SMS*/

//RESTORE_VOL_RESTRICT=0-1

/*Network*/

//NIC_ENABLED=0-1
//NIC_ADDRESS=00-00-00-00-00-00
//NIC_SUBNET_ADDRESS=00.000.00.000
//NIC_SUBNET_MASK=000.000.000.0
//NIC_SUBNET_AUTOGET=0-1

[Selections]

/*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.            */

//JOBHISTORY_GUID={00000000-0000-0000-0000-000000000000}

SELECTION1=\\intamac-01\c\backup\Backup.bkf
START_DATE=11/19/2012
END_DATE=11/21/2012


[Schedule]

//SCHED_EFFECTIVE=mm/dd/yyyy
//SCHED_STARTTIME=hh:mm:ss
//SCHED_ENDTIME=hh:mm:ss

//SCHED_RESTART_INTERVAL=hh:mm:ss

/* SCHED_REPEAT_INTERVAL is the Day Interval and is given as number of days. */
//SCHED_REPEAT_INTERVAL=1-999

/* SCHED_ANCHOR is the day from which to calculate the Day Interval. */
//SCHED_ANCHOR=mm/dd/yyyy

/* 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_DAYSOFMONTH=1,15,23

/* 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_DAYSOFWEEK=1/1,2/4

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

SCHED_INCLUDEDATE2, etc. */
//SCHED_INCLUDEDATE1=mm/dd/yyyy

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

SCHED_EXCLUDEDATE2, etc. */
//SCHED_EXCLUDEDATE1=mm/dd/yyyy

/* If none of the SCHED_ values are given then DATE and TIME will be used to set the "Run On" value. */
//DATE=mm/dd/yyyy
//TIME=hh:mm:ss

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

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

//HOLD=0-1
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

ASKER

hiya
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

ASKER

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" code...now 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

ASKER

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...
ASKER CERTIFIED SOLUTION
Avatar of denbosse
denbosse
Flag of Ireland image

Link to home
membership
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

ASKER

Hiya
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

ASKER

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...