使用壓縮檔格式,將某個設定檔中所包含的多個設定檔,匯出至指定的目標。
語法
export --name=<profile name> [--scope=<user|host>] [--entity=<entity>] <target>
--name=<profile name>:要匯出的設定檔名稱。此為必要選項。若在該層中沒有設定檔,或有多個設定檔具有此名稱和此範圍,則指令會發生錯誤並結束。
--scope=<user|host>:設定檔的範圍,可以是使用者或主機。若未指定,則預設為使用者範圍。
--entity=<entity>:設定檔所在的元素。若未指定,則預設為根組織或網域元素,視 --scope 選項而定。
<target>:將匯出設定檔之壓縮檔的完整路徑。若路徑未指定任何檔案名稱,則檔案名稱預設為 <profile name>.zip。若無法寫入目標,則指令會發生錯誤並結束。
% pgtool export --scope=host --name=HostProfile1 /tmp/newdir
已將位於根網域的「HostProfile1」匯出至建立於新目錄 /tmp/newdir 中的 HostProfile1.zip。