jobs

fg、bg、jobs、&、ctrl + z都是跟系统任务有关的,虽然现在基本上不怎么需要用到这些命令,但学会了也是很实用的
一。& 最经常被用到
   这个用在一个命令的最后,可以把这个命令放到后台执行
二。ctrl + z
     可以将一个正在前台执行的命令放到后台,并且暂停
三。jobs
     查看当前有多少在后台运行的命令
四。fg
     将后台中的命令调至前台继续运行
   如果后台中有多个命令,可以用 fg %jobnumber将选中的命令调出,%jobnumber是通过jobs命令查到的后台正在执行的命令的序号(不是pid)
五。bg
     将一个在后台暂停的命令,变成继续执行
   如果后台中有多个命令,可以用bg %jobnumber将选中的命令调出,%jobnumber是通过jobs命令查到的后台正在执行的命令的序号(不是pid) 

### GitHub Actions Jobs YAML Configuration Example For configuring jobs within GitHub Actions, the following is an example of how one can structure a workflow file that defines multiple jobs: ```yaml name: CI on: push: branches: - main pull_request: branches: - main jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Set up Node.js uses: actions/setup-node@v1 with: node-version: '14' - name: Install dependencies run: npm install - name: Build project run: npm run build test: needs: build runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Set up Node.js uses: actions/setup-node@v1 with: node-version: '14' - name: Run tests run: npm test ``` This configuration demonstrates setting up two separate jobs (`build` and `test`) where the `test` job depends on successful completion of the `build` job[^2]. ### Kubernetes Job YAML Configuration Example When it comes to defining jobs in Kubernetes, these are typically used for batch processing tasks. Below is an example of what such a definition might look like: ```yaml apiVersion: batch/v1 kind: Job metadata: name: pi-with-ttl spec: ttlSecondsAfterFinished: 100 template: spec: containers: - name: pi image: perl command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] restartPolicy: Never ``` In this snippet, a simple Perl program calculates Pi to 2000 places as part of its execution before terminating. The TTL (Time To Live) controller will clean up the finished job after 100 seconds have passed since all pods associated with the job complete their work.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值