b2c-job

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

B2C Job Skill

B2C 作业技能

Use the
b2c
CLI plugin to run existing jobs and import/export site archives on Salesforce B2C Commerce instances.
Tip: If
b2c
is not installed globally, use
npx @salesforce/b2c-cli
instead (e.g.,
npx @salesforce/b2c-cli job run
).
Creating a new job? If you need to write custom job step code (batch processing, scheduled tasks, data sync), use the
b2c:b2c-custom-job-steps
skill instead.
使用
b2c
CLI插件在Salesforce B2C Commerce实例上运行现有作业并导入/导出站点归档文件。
提示: 如果未全局安装
b2c
,请改用
npx @salesforce/b2c-cli
(例如:
npx @salesforce/b2c-cli job run
)。
需要创建新作业? 如果你需要编写自定义作业步骤代码(批处理、定时任务、数据同步),请改用
b2c:b2c-custom-job-steps
技能。

Examples

示例

Run a Job

运行作业

bash
undefined
bash
undefined

run a job and return immediately

run a job and return immediately

b2c job run my-custom-job
b2c job run my-custom-job

run a job and wait for completion

run a job and wait for completion

b2c job run my-custom-job --wait
b2c job run my-custom-job --wait

run a job with a timeout (in seconds)

run a job with a timeout (in seconds)

b2c job run my-custom-job --wait --timeout 600
b2c job run my-custom-job --wait --timeout 600

run a job with parameters (standard jobs)

run a job with parameters (standard jobs)

b2c job run my-custom-job -P "SiteScope={"all_storefront_sites":true}" -P OtherParam=value
b2c job run my-custom-job -P "SiteScope={"all_storefront_sites":true}" -P OtherParam=value

show job log if the job fails

show job log if the job fails

b2c job run my-custom-job --wait --show-log
undefined
b2c job run my-custom-job --wait --show-log
undefined

Run System Jobs with Custom Request Bodies

使用自定义请求体运行系统作业

Some system jobs (like search indexing) use non-standard request schemas. Use
--body
to provide a raw JSON request body:
bash
undefined
部分系统作业(如搜索索引)使用非标准请求模式。使用
--body
参数提供原始JSON请求体:
bash
undefined

run search index job for specific sites

run search index job for specific sites

b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch","SiteGenesis"]}'
b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch","SiteGenesis"]}'

run search index job for a single site

run search index job for a single site

b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch"]}'

Note: `--body` and `-P` are mutually exclusive.
b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch"]}'

注意:`--body`和`-P`参数不能同时使用。

Import Site Archives

导入站点归档文件

The
job import
command automatically waits for the import job to complete before returning. It does not use the
--wait
option.
bash
undefined
job import
命令会自动等待导入作业完成后再返回,无需使用
--wait
选项。
bash
undefined

import a local directory as a site archive

import a local directory as a site archive

b2c job import ./my-site-data
b2c job import ./my-site-data

import a local zip file

import a local zip file

b2c job import ./export.zip
b2c job import ./export.zip

keep the archive on the instance after import

keep the archive on the instance after import

b2c job import ./my-site-data --keep-archive
b2c job import ./my-site-data --keep-archive

import an archive that already exists on the instance (in Impex/src/instance/)

import an archive that already exists on the instance (in Impex/src/instance/)

b2c job import existing-archive.zip --remote
b2c job import existing-archive.zip --remote

show job log on failure

show job log on failure

b2c job import ./my-site-data --show-log
undefined
b2c job import ./my-site-data --show-log
undefined

Export Site Archives

导出站点归档文件

bash
undefined
bash
undefined

export site data using the job export command

export site data using the job export command

b2c job export
undefined
b2c job export
undefined

Search Job Executions

搜索作业执行记录

bash
undefined
bash
undefined

search for job executions

search for job executions

b2c job search
b2c job search

search with JSON output

search with JSON output

b2c job search --json
undefined
b2c job search --json
undefined

Wait for Job Completion

等待作业完成

bash
undefined
bash
undefined

wait for a specific job execution to complete

wait for a specific job execution to complete

b2c job wait <execution-id>
undefined
b2c job wait <execution-id>
undefined

More Commands

更多命令

See
b2c job --help
for a full list of available commands and options in the
job
topic.
查看
b2c job --help
获取
job
主题下的所有可用命令和选项的完整列表。

Related Skills

相关技能

  • b2c:b2c-custom-job-steps
    - For creating new custom job steps (batch processing scripts, scheduled tasks, data sync jobs)
  • b2c-cli:b2c-site-import-export
    - For site archive structure and metadata XML patterns
  • b2c:b2c-custom-job-steps
    - 用于创建新的自定义作业步骤(批处理脚本、定时任务、数据同步作业)
  • b2c-cli:b2c-site-import-export
    - 用于了解站点归档文件结构和元数据XML模式