Linux/ubuntu AWK / BEGIN / END的用法

本文介绍了在Linux的AWK命令中,BEGIN和END特殊表达式的用法。BEGIN用于在处理输入前初始化变量,END则在处理完所有输入后执行,常用于输出最终结果。通过实例展示了如何利用BEGIN和END格式化输出密码列表和计算销售文件的总金额。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://blog.youkuaiyun.com/frank_ldw/article/details/86534675

BEGIN和END:

在Unix awk中两个特别的表达式,BEGIN和END,这两者都可用于pattern中(参考前面的awk语法),提供BEGIN和END的作用是给程序赋予初始状态和在程序结束之后执行一些扫尾的工作。

任何在BEGIN之后列出的操作(在{}内)将在Unix awk开始扫描输入之前执行,而END之后列出的操作将在扫描完全部的输入之后执行。因此,通常使用BEGIN来显示变量和预置(初始化)变量,使用END来输出最终结果

换句话说:BEGIN后面{}的先执行,执行结果由END后{}输出。

password.lst

root@lidw:~# cat password.lst
1:192.168.88.128:22:root:toor:虚拟机web服务器
2:192.168.88.130:22:ca0gu0:toor:虚拟机mysql数据库服务器
103:192.168.88.4:22:root:sellercube:本地开发服务器

root@lidw:~# awk 'BEGIN {FS=":"} {printf("%3s | %15s | %s\n",$1,$2,$6)}' ./password.lst
  1 |  192.168.88.128 | 虚拟机web服务器
  2 |  192.168.88.130 | 虚拟机mysql数据库服务器
103 |    192.168.88.4 | 本地开发服务器
或者:

root@lidw:~# cat password.lst | awk 'BEGIN {FS=":"} {printf("%3s | %15s | %s\n",$1,$2,$6)}'
  1 |  192.168.88.128 | 虚拟机web服务器
  2 |  192.168.88.130 | 虚拟机mysql数据库服务器
103 |    192.168.88.4 | 本地开发服务器

 

例:累计销售文件xs中的销售金额(假设销售金额在记录的第三字段):
$awk
'BEGIN { FS=":";print "统计销售金额";total=0}
{print $3;total=total+$3;}
END {printf "销售金额总计:%.2f",total}' sx


注意:BEGIN之前和END之后需要‘’(单引号)

awk 'BEGIN {*********} END{***********}'


 

Jun 22 01:32:08 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:09 hi3798mv100 python[2487]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 01:32:19 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 python[2663]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 01:32:30 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 python[2710]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 01:32:40 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 python[2761]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 10:37:24 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 python[3011]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 10:37:34 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 python[3052]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 10:37:45 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:45 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:45 hi3798mv100 python[3093]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 10:37:55 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 10:37:55 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:55 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. lines 1-44 -- Logs begin at Tue 2024-06-18 04:29:40 CST, end at Sun 2025-06-22 11:03:38 CST. -- Jun 22 01:32:08 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:09 hi3798mv100 python[2487]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 1. Jun 22 01:32:19 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 python[2663]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 2. Jun 22 01:32:30 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 python[2710]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 3. Jun 22 01:32:40 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 python[2761]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 4. Jun 22 10:37:24 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 python[3011]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 5. Jun 22 10:37:34 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 python[3052]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 6. Jun 22 10:37:45 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:45 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:45 hi3798mv100 python[3093]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:55 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 7. Jun 22 10:37:55 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:55 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. lines 1-44 -- Logs begin at Tue 2024-06-18 04:29:40 CST, end at Sun 2025-06-22 11:03:38 CST. -- Jun 22 01:32:08 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:09 hi3798mv100 python[2487]: /home/ubuntu/moonraker-env/bin/python: can't open fi> Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, s> Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart coun> Jun 22 01:32:19 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 python[2663]: /home/ubuntu/moonraker-env/bin/python: can't open fi> Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, s> Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart coun> Jun 22 01:32:30 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 python[2710]: /home/ubuntu/moonraker-env/bin/python: can't open fi> Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, s> Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart coun> Jun 22 01:32:40 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 python[2761]: /home/ubuntu/moonraker-env/bin/python: can't open fi> Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, s> Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart coun> Jun 22 10:37:24 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 python[3011]: /home/ubuntu/moonraker-env/bin/python: can't open fi> Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, s> Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart coun> Jun 22 10:37:34 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 python[3052]: /home/ubuntu/moonraker-env/bin/python: can't open fi> lines 1-33 -- Logs begin at Tue 2024-06-18 04:29:40 CST, end at Sun 2025-06-22 11:03:38 C> Jun 22 01:32:08 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:09 hi3798mv100 python[2487]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 01:32:19 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 python[2663]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 01:32:30 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 python[2710]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 01:32:40 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 python[2761]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 10:37:24 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 python[3011]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 10:37:34 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 python[3052]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 10:37:45 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:45 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:45 hi3798mv100 python[3093]: /home/ubuntu/moonraker-env/bin/pytho> Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Main process exited> Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Failed with result > Jun 22 10:37:55 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart j> Jun 22 10:37:55 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:55 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. lines 1-44 -- Logs begin at Tue 2024-06-18 04:29:40 CST, end at Sun 2025-06-22 11:03:38 CST. -- Jun 22 01:32:08 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:09 hi3798mv100 python[2487]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 01:32:09 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 1. Jun 22 01:32:19 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:19 hi3798mv100 python[2663]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 01:32:19 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 2. Jun 22 01:32:30 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:30 hi3798mv100 python[2710]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 01:32:30 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 3. Jun 22 01:32:40 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 01:32:40 hi3798mv100 python[2761]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 01:32:40 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 4. Jun 22 10:37:24 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:24 hi3798mv100 python[3011]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 10:37:24 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 5. Jun 22 10:37:34 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:34 hi3798mv100 python[3052]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 10:37:34 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 6. Jun 22 10:37:45 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:45 hi3798mv100 systemd[1]: Started API Server for Klipper SV1. Jun 22 10:37:45 hi3798mv100 python[3093]: /home/ubuntu/moonraker-env/bin/python: can't open file '/home/ubuntu/moonraker/moonraker.py': [Errno 2] No such file or directory Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Jun 22 10:37:45 hi3798mv100 systemd[1]: moonraker.service: Failed with result 'exit-code'. Jun 22 10:37:55 hi3798mv100 systemd[1]: moonraker.service: Scheduled restart job, restart counter is at 7. Jun 22 10:37:55 hi3798mv100 systemd[1]: Stopped API Server for Klipper SV1. Jun 22 10:37:55 hi3798mv100 systemd[1]: Started API Server for Klipper SV1.
06-23
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值