Create a Command FileWhen you have a sequence of commands that you type over and over again, you can save time by typing these commands once into a command file. A command file is a text file containing a list of PacketWise CLI commands. When you run the command file, the commands are executed sequentially. You can either use the run command to execute the command file from the CLI prompt, or use the schedule feature to schedule the command file to run on a regular basis. Not all CLI commands can be included in a command file. First of all, there is a requirement that the CLI command run without additional user input. If the command is interactive and prompts the user for input (such as the event new command in command-prompting mode), the command won't work. Second, many of the file utility and diagnostic commands (such as cat, cd, cmp, date, dnslookup, du, echo, ls, mkdir, mv, ping, and rm) cannot be included in a command file. Exceptions are ftpget, ftpput, zip, and unzip these commands can be included and are quite useful in command files. Although you can create a command file in any text editor, you may prefer the convenience of using PacketWise's Command File Editor. With the built-in editor, you can save the file directly on the PacketShaper or PacketSeeker unit.
To create a command file: 1. In the File Browser,
navigate to the directory where you want to store your command file. 2. Click the new cmd file button. The Command
File Editor window appears. 3. (Optional) In the Contents area, enter a description next to the #Title text. You can use this comment line to describe the function of the command file. 4. Enter the CLI commands, with each command on a
separate line. (See Command-Line
Interface for descriptions and syntax of each command.) 5. To save the file, enter a descriptive name (up
to 8 characters) in the File Name field and click save. 6. To make sure you entered the commands with the correct syntax and that the commands work as expected, click run. The Results area displays the output of each command and any error messages that may have occurred. 7. Modify the commands as necessary, and then repeat steps 5 and 6 until the command file runs successfully. 8. Click the back button and observe that the command file you created is listed in the Contents of folder window. If it's not listed, click update to refresh the screen. If you need to modify the command file in the future, use the edit button that appears next to the filename. Note that the maximum file size that can be edited is 8K. See also:
|
PacketGuide for PacketWise® Version 6.0