static ScheduledTaskSpec createWeeklySchedulerSpec(
String taskName)
{
// create an action to take snapshot
MethodAction action = new MethodAction();
action.setName("CreateSnapshot_Task");
MethodActionArgument nameArg = new MethodActionArgument();
nameArg.setValue("My Snapshot");
MethodActionArgument descArg = new MethodActionArgument();
descArg.setValue("My Description");
MethodActionArgument memArg = new MethodActionArgument();
memArg.setValue(true);
MethodActionArgument quieArg = new MethodActionArgument();
quieArg.setValue(true);
action.setArgument(new MethodActionArgument[]
{nameArg, descArg, memArg, quieArg });
// run the task only once every week at Saturday midnight
WeeklyTaskScheduler scheduler = new WeeklyTaskScheduler();
scheduler.setSaturday(true);