高级自定义 > 业务逻辑自定义 > 包自定义 > Windchill 复制包命令行示例脚本
Windchill 复制包命令行示例脚本
您可以自动执行上载和导入已接收交付的进程。本节将展示一些示例脚本,并且提供了如何使用作业或任务计划程序实现此操作的信息。
* 
有关该实用程序的详细信息,请参阅 Windchill 包命令行实用程序
Windows
在下列示例中,upload_import_rd.cmd 脚本每 8 小时运行一次。
schtasks /create /tn "Context Replication cron job" /tr
"C:\import_scripts\upload_import_rd.cmd /sc hourly 8
这是一个示例 upload_import_rd.cmd 脚本,用于上载和导入单个作业中所有已上载的已接收交付。

@echo off
GOTO EXECUTE
:EXECUTE
cd C:\ptc\Windchill\bin
windchill.exe com.ptc.windchill.rd.cli.WindchillPackage import -u demo
-c "/wt.inf.container.OrgContainer=Demo Organization/wt.pdmlink.PDMLinkProduct=NI_import"
-l "C:\Packages" -r -d
IF %ERRORLEVEL% == 1 GOTO IMPORT_FAILURE
GOTO END
:IMPORT_FAILURE
ECHO [Error] Import command has failed. Please see logs for details
:END
UNIX
在下列示例中,upload_import.sh shell 脚本每 8 小时运行一次。
* 8 * * * /bin/sh /path/to/script/upload_import.sh
在下列示例中,shell 脚本按顺序运行上载和导入命令,并在文件中对上载的输入进行重定向。然后提供此文件作为导入命令的输入,以便仅针对同一脚本中上载的已接收交付启动导入。
#!/bin/sh
java com.ptc.windchill.rd.cli.WindchillPackage import -u wcadmin -l
“D:\packages” -c “/wt.inf.container.OrgContainer=Demo Organization/wt.pdmlink.
PDMLinkProduct=Drive System” -d -m
IF [$?= 1]then exit 1
fi
exit 0
这对您有帮助吗?