克朗在centos工作(Cron job in centos)

编程入门 行业动态 更新时间:2024-10-25 19:33:17
克朗在centos工作(Cron job in centos)

我在crontab工作中几乎没有疑问

我的场景:我每天在23小时放置两个cron作业,1个作业是将文件移动到另一个目录,第二个作业是将此文件上传到ftp服务器。

如何获取上次运行时间cron job和上次运行结果(如果成功或失败)centos中的详细信息? 如何查看目前在centos中运行的cron作业? (例如:第一份工作从23小时开始,第二份工作从23:30开始,到5分钟后结束{假设第一个cron工作应该在30分钟后完成,我想在现场查看这份工作运行细节。(30分钟持续时间) )})

记录或实时视图

注意:以root用户权限运行。

谢谢G Dhamu

I have few more doubt in crontab jobs

My scenario: I have put two cron jobs at 23 Hrs every day 1 job is move files to another directory & the 2nd job is upload this file to ftp server.

How to get last ran time cron job & last run result( if succeeded or failed )details in centos ? How to view at present running cron job in centos ? ( example : 1st job starting at 23 Hrs & the 2nd job starting at 23:30 Hrs and ending after 5 mins { assuming 1st cron job should be completed after 30mins , I want to view this job running details in live.(30 mints duration ) })

Log or live view

Note: Running as root user privilege.

Thanks G Dhamu

最满意答案

您可以在/var/log/cron (默认位置)下查看由cron运行的作业的日志 你不能拥有“实时视图”,因为你不是那个正在运行它的人......你可以做什么,是尾部cron-log或让你的程序将其输出写入不同的日志并打开一个关闭它的屏幕。 You can watch the logs of jobs that were ran by cron under /var/log/cron (default location) You cannot have a "live view" since you're not the one who's running it... What you can do, is tail cron-log or have your program write its output to a different log and open a screen that tails it.

更多推荐

本文发布于:2023-07-05 06:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034350.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:克朗   工作   job   centos   Cron

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!