JAMS Developer Guide
Enabling or Disabling a Job

If you want to temporarily enable or disable a Job, you can do this programmatically with C#. These samples show you how to enable or disable a Job.

Before you enable or disable a Job, check for any dependencies on that Job.

Enabling a Job
Copy Code
//
// Get a connection to our JAMS Server
// You will probably have to change the node name "localhost"
// to the name of your JAMS Server
//
var server = Server.GetServer("localhost");

//
// Enable the BackupDB job.
//
Job.Load(out Job backupDBJob, @"\Samples\BackupDB", server);
backupDBJob.Properties.SetValue("Enabled", true);
backupDBJob.Update();

Disabling a Job
Copy Code
//
// Get a connection to our JAMS Server
// You will probably have to change the node name "localhost"
// to the name of your JAMS Server
//
var server = Server.GetServer("localhost");

//
// Disable the BackupDB job.
//
Job.Load(out Job backupDBJob, @"\Samples\BackupDB", server);
backupDBJob.Properties.SetValue("Enabled", false);
backupDBJob.Update();

 

 


Copyright © Fortra, LLC and its group of companies.
All trademarks and registered trademarks are the property of their respective owners.