When you use the svcbundle command to create a scheduled service, you must specify the interval property as well as both the service-name and start-method properties. By default, svcbundle creates a transient service. When you specify -s period, svcbundle creates a periodic service.
In this example, the start method for this service is named sched_ex. Copy this executable to /lib/svc/method/sched_ex.
In this example, the service name is site/sched_ex. Specify an interval for the start method scheduling. Do not specify any of the following properties: bundle-type, duration, model, rc-script, refresh-method, or stop-method.
$ svcbundle -o /tmp/sched_ex.xml -s service-name=site/sched_ex \ -s start-method=/lib/svc/method/sched_ex -s interval=week
When you specify the interval property, svcbundle creates a scheduled_method element, which causes the restarter for the service to be set to the periodic restarter when the manifest is imported. The value of the interval property becomes the value of the interval attribute of the scheduled_method element. The value of the start-method property becomes the value of the exec attribute of the scheduled_method element.
Verify that the content of the /tmp/ex_svc.xml manifest is what you need. You might want to make changes such as the following:
Specify additional constraints in the scheduled_method element.
Specify additional property groups of type schedule, as described in Scheduling Invocations at Irregular Intervals.
Add a method_context element in the scheduled_method element.
Change the value of the enabled attribute of the default instance from true to false.
Add comments to describe what the service does and how the properties of the service are used.
Use the svccfg validate command to make sure the service manifest is valid.
$ cp /tmp/sched_ex.xml /lib/svc/manifest/site/sched_ex.xml
$ svcadm restart manifest-import
Verify that the new service exists and is in the expected state.
$ svcs sched_ex