Specialized Administration > Windchill Directory Server Administration > Backing Up and Restoring LDAP Directory Data > Scheduled Tasks > Scheduling Tasks Using the Command Line
  
Scheduling Tasks Using the Command Line
Scheduling tasks via command line provides the most flexibility. The following documents several examples using some of the additional options.
This example schedules a recurring task that starts a full backup at the specified start time and schedules it to run at 2:55am on Wednesday of each week.
backup -h localhost -p 4444 -D "cn=manager" -w admin -X --backUpAll --completionNotify
admin@MyCompany.com --errorNotify admin@MyCompany.com --backupDirectory
D:\WDSDataBackups\scheduled --recurringTask "55 02 * * 3"
This example schedules a recurring task that starts a full backup at the specified start time and schedules it to run at 1:00am each day except Wednesday.
backup -h localhost -p 4444 -D "cn=manager" -w admin -X --backUpAll --incremental
--completionNotify admin@MyCompany.com --errorNotify admin@MyCompany.com
--backupDirectory D:\WDSDataBackups\scheduled --recurringTask "00 01 * * 0,1,2,4,5,6"
When scheduling a one time execution task the --start parameter must be supplied. The start time is specified as: YYYYMMDDhhmmss.
Recurring task execution time is specified as with the --recurringTask argument and is specified as "<minute><hour><day of month><month of year><day of Week>. Valid values are:
Minute [0,59]
Hour [0,23]
Day of the month [1,31]
Month of the year [1,12]
Day of the week [0,6]
* 
0=Sunday
The following is an example that specifies a task that is to run at minute 15,30 and 45 every hour, every day of the month, every month and every day of the week:
--recurringTask "15,30,45 * * * *"
When a recurring task is scheduled, two tasks are scheduled with IDs similar to the following:
ExportTask-a75fed4e-164f-4343-bee4-edc88b306037
ExportTask-a75fed4e-164f-4343-bee4-edc88b306037-20100205114500000
Canceling the task using the first ID cancels the current task and all future tasks. Canceling the task with the second ID only cancels the one currently waiting instance of the task. Canceling a task scheduled to run each day will cancel the current task and schedule the task to run the next day.
Export-ldif can be scheduled similarly. For export-ldif, a single export file is specified that will overwrite an existing file. The specified LDIF file should be included in a regularly scheduled file backup procedure to maintain multiple copies.
In addition to using the control panel to manage tasks, the command managed-tasks can be used to mange tasks from the command line.
The following example displays the status of all tasks:
manage-tasks.bat --summary "--hostname" "localhost" "--port" "4444" "--bindDN"
"cn=Manager" "--bindPassword" "admin" "--trustAll" "--noPropertiesFile"
The following example displays the detailed status of a single task:
* 
The --info property is obtained from the ouput of the previous example.
manage-tasks.bat --info "ExportTask-a75fed4e-164f-4343-bee4-edc88b306037-
20100205114500000" "--hostname" "localhost" "--port" "4444" "--bindDN"
"cn=Manager" "--bindPassword" "admin" "--trustAll" "--noPropertiesFile"
The following example cancels a single task:
* 
The --cancel property is obtained from the output of the previous example.
manage-tasks.bat --cancel "ExportTask-a75fed4e-164f-4343-bee4-edc88b306037-
20100205114500000" "--hostname" "localhost" "--port" "4444" "--bindDN"
"cn=Manager" "--bindPassword" "admin" "--trustAll" "--noPropertiesFile"