cancel
Showing results for 
Search instead for 
Did you mean: 

Run one job automatically after a completed job

Marcopolo
Level 6

We have a full backup job that runs every night, but the completion time can vary.

We also have another job that reports the total byte count.

Since the full backup completion time can vary, we have the byte job set to run about a hour later.

 

My question is can I somehow trigger the byte job to run when the full backup job has completed?

16 REPLIES 16

pkh
Moderator
Moderator
   VIP    Certified

Yes, you can do so using BEMCMD.  See my blog below

https://www-secure.symantec.com/connect/blogs/use-bemcmd-start-jobs

Marcopolo
Level 6

Thanks, that looks sopt on.

What do the -o1 -j switches relate to because performing a ? is not showing a full reference for them?

pkh
Moderator
Moderator
   VIP    Certified

BEMCMD is quite complex and it would not be possible to list all the switches at the commandline.  There is a manual for the commandline applet in the BE installation directory.

-o1 is for starting the job and -j is the jobname to be started.

Marcopolo
Level 6

Cheers, I'll give it a test and update the thread accordingly

riva11
Level 6

Documentation about command and switches is available here : Symantec Backup Exec (2010 Command Line Applet (BEMCMD) Guide

 

 

Marcopolo
Level 6

Strange, it never ran the post command and no errors either

"D:\Program Files\Symantec\Backup Exec\NT\bemcmd.exe" -o1 -j"Report for Daily to SDLT (full)"

pkh
Moderator
Moderator
   VIP    Certified

To make sure that your command is o.k.  Start up a command prompt, issue the command and see whether your job starts.  If it does not, then it is a syntax problem

Marcopolo
Level 6

Ok, it's failing, receiving a -1 response. I wonder if it's because the job being submitted has the same name as the held/scheduled job. Reading the documentation it refers to

bemcmd -o1 -j"Operations Weekly"

In this example, -o1 is the operation to submit the backup job. The command line switch

-j specifies the name of the backup job. Because the job name contains spaces, quotation

marks are required around the job name.

The job “Operations Weekly” was previously created through the Backup Exec

administration console. By default, the backup will be done on the computer where the

Command Line applet is executed.

Then reading further down it relates to jobs with the same name and to use the ID, still trying to find it.

-o1 Run backup job Runs a backup job that has been previously defined. Returns a job instance ID. Also returns a 1 if the command succeeds or a -1 if the command fails.

-jjob name or

-ijob ID

Required. Specifies the name or the job ID of the previously defined job that Backup Exec should run.

Note If there are jobs with the same name, only one of the jobs will run. To ensure that the correct job runs, you should use the job ID instead of the job name to specify which job will run.

I can understand the Job not running if there is a job there with the same name, but surely you require a job in the first place for the post command to work

pkh
Moderator
Moderator
   VIP    Certified

The switch is definitely working as described in my blog.  I am using it everyday.

It is probably the jobname that is wrong.  You can verify that it is working by creating a test job with a simple name like TEST and try the command again.

Marcopolo
Level 6

Ok, just setup the job again as 'Run Now' on 'HOLD'  with the job name 'test'

Ran this from the command line "D:\Program Files\Symantec\Backup Exec\NT\bemcmd.exe" -o1 -j"test" and received a RETURN VALUE: -1

pkh
Moderator
Moderator
   VIP    Certified

What version of BE are you using?  Are you running this command on the media server?

Marcopolo
Level 6

2010, and running the command on the server BE is installed on.

pkh
Moderator
Moderator
   VIP    Certified

Try BEMCMD -o22 -j to list the jobs that are on hold, so that you would know what are the jobnames.  Remember the jobnames are case-sensitive.

Marcopolo
Level 6

D:\Program Files\Symantec\Backup Exec\NT>BEMCMD -o22 -j


JOB NAME: test

NUMBER OF OBJECTS: 1
RETURN VALUE: 1

D:\Program Files\Symantec\Backup Exec\NT>bemcmd -o1 -j"test"

RETURN VALUE: -1

Marcopolo
Level 6

I'm wondering if it's because the job is not a 'Backup' and a 'Report'

pkh
Moderator
Moderator
   VIP    Certified

What kind of job is it?  You should try a backup job and just select a file for backup.  It will be a quick test.