Remote Schedules

In this tutorial I will show you how to use Power Manager from the command line. I will then discuss how to deploy new schedules over a network.

Scheduling a Remote Computer

This tutorial assumes a basic level of familiarity with the command line and Terminal on Mac OS X. If the command line is new to you, don't panic as all the steps are provided.

For the rest of this article I will refer to two computers: a local computer, and a remote computer. Both computers must have Power Manager installed.

The remote computer must have Remote Login enabled.

Overview

This tutorial can be reduced to the following set of commands.

Line  
1
/usr/local/powermanager/bin/powermanagerctl scheduler.events > ~/Desktop/schedule.plist
2
scp ~/Desktop/schedule.plist admin@192.168.90.1:/tmp/.
3
ssh admin@192.168.90.1
4
/usr/local/powermanager/bin/powermanagerctl scheduler.setevents ~/Desktop/schedule.plist
5
exit

Create a Schedule

We need a schedule to deploy on the client computer. The schedule is an XML Property List file (.plist) and can be created manually, by a script, or with the help of Power Manager's System Preference.

For this tutorial I am going to use the System Preference, but it is worthwhile taking a look at the schedule file generated. It is human readable and can be edited with a text editor.

Create your desired schedule using the System Preferences.

Pipe the Schedule to a File

With the new schedule created in the System Preferences, you pipe the schedule's events to an XML property list file.

In the Terminal enter the following command:

Line  
1
/usr/local/powermanager/bin/powermanagerctl scheduler.events > ~/Desktop/schedule.plist

Copy the File to the Remote Computer

We need to get our schedule onto the remote computer. There are numerous ways of doing this and I will discuss alternatives in a moment.

To copy our schedule we are going to use the secure copy command (scp) to copy the file across the network.

In the Terminal modify and enter the following command:

Line  
1
scp -v ~/Desktop/schedule.plist admin@192.168.90.1:/tmp/.

You must modify two parts of the previous secure copy command.

If all goes well, you will be asked for the remote user's password before the copy occurs.

Connect and Set the Schedule

We have created a new schedule locally, copied it securely across the network, and are now ready to install it.

We need to tell the remote copy of Power Manager to use our new schedule.

In the Terminal modify and enter the following commands:

Line  
1
ssh admin@192.168.90.1
2
/usr/local/powermanager/bin/powermanagerctl schedule.setevents /tmp/schedule.plist
3
exit

You must modify two parts of the previous secure shell command.

Congratulations

You have just installed a schedule on a remote computer.