Nhãn hiệu của chúng tôi

Impact-Company-Logo-English Black-01-177x54

Chào mừng bạn đến với Trang web của Schneider Electric

Chào mừng đến với trang web của chúng tôi.
		
Hôm nay chúng tôi có thể giúp gì cho bạn?
How to run and troubleshoot scripts / command files with PowerChute Network Shutdown on Unix/Linux

Issue:
How to run and troubleshoot scripts files with PowerChute Network Shutdown on Unix/Linux

Product Line:
PowerChute Network Shutdown

Environment:
All supported Unix and Linux OS

Cause:
Informational

Solution:

Note: If you are having problems getting a script to work on a supported 64-bit processor and operating system, please make sure you follow the 64-bit installation procedure listed in the PowerChute Network Shutdown Installation Manual.

Shell Scripts in a UNIX/Linux environment are essentially a series of commands and instructions stored in a file, allowing all commands & instructions to be executed simultaneously by running the file. Typically, the file is run by a specified shell or some other interpreter. In a UNIX/Linux environment, the first line of a script specifies the interpreter or shell that runs it. The Bourne shell, for instance, is usually located at the following absolute path:
/bin/sh

Therefore, scripts that are written to be run by the Bourne shell will typically begin with the following line:
#!/bin/sh

Scripts to be run by PowerChute Network Shutdown must be written in the Bourne Shell and should start with a line that resembles the line above. Thus, the first thing to verify when a script is not running correctly in PowerChute Network Shutdown is that it is written for the Bourne Shell. The second thing to verify is that the Bourne Shell is being called correctly on the first line of the script. It is essential to keep in mind that if the script is not set up properly, it may run correctly when executed manually at the shell prompt.

NOTE: With the release of PowerChute Network, Shutdown 4.4, all command files and SSH files must reside in /opt/APC/PowerChute/user_files. When adding the file to the PowerChute UI or pcnsconfig.ini, the full path must be entered.

The following is an example of a script that will output the words "This is a command file test." to a file called test.txt in the APC directory:

#!/bin/sh
echo "This is a command file test." >> /opt/APC/test.txt

If this file were saved as scr.sh and given executable permissions, when run from the shell prompt, it would create a file called test.txt in the APC directory that contained the words "This is a command file test." If the script were to be run by PowerChute Network Shutdown, this is how it should look:

#!/bin/sh
echo "This is a command file test." >> /opt/APC/test.txt

Notice that the first line of the script specifies that #!/bin/sh will be used to execute the commands. Once this change has been made to the script, PowerChute Network Shutdown should execute it properly.

Schneider Electric Việt Nam

Tìm hiểu thêm
Phạm vi:
Danh mục:
Tìm hiểu thêm
Phạm vi:
Danh mục:
  • Tài liệu về Sản phẩm
  • Tải xuống phần mềm
  • Công cụ chọn Sản phẩm
  • Thay thế và thay đổi sản phẩm
  • Trung tâm Hỗ trợ
  • Tìm Văn phòng của chúng tôi
  • Nhận báo giá
  • Tìm Nhà Phân phối
  • Cộng đồng Schneider Electric
  • Cơ hội nghề nghiệp
  • Hồ sơ doanh nghiệp
  • Báo cáo hành vi sai trái
  • Khả năng truy cập
  • Phòng tin tức
  • Nhà đầu tư
  • EcoStruxure
  • Tìm việc
  • Blog
  • Chính sách bảo mật
  • Thông báo về Cookie
  • Điều khoản sử dụng
  • Change your cookie settings