Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
LINUX中如何通过CRONJOB调度脚本_Linux_Bash - Fatal编程技术网

LINUX中如何通过CRONJOB调度脚本

LINUX中如何通过CRONJOB调度脚本,linux,bash,Linux,Bash,我已经创建了一个脚本,它将解析我已经存在的文件。我想在其中应用cronjob,在其中我想给出脚本每分钟自动执行的时间。如何在linux脚本中执行它?将以下内容添加到crontab: * * * * * /path/to/your/script 使用命令crontab-e编辑您的crontab。您可以通过条目每分钟运行一个脚本 但是,由于您希望在文件发生更改时触发某些操作,特别是在Linux上,您还可以使用一些工具,并在特定文件被修改时运行某些操作。然后使用谢谢你的回复。我已经在crontab中

我已经创建了一个脚本,它将解析我已经存在的文件。我想在其中应用cronjob,在其中我想给出脚本每分钟自动执行的时间。如何在linux脚本中执行它?

将以下内容添加到crontab:

* * * * * /path/to/your/script
使用命令
crontab-e
编辑您的crontab。

您可以通过条目每分钟运行一个脚本


但是,由于您希望在文件发生更改时触发某些操作,特别是在Linux上,您还可以使用一些工具,并在特定文件被修改时运行某些操作。然后使用

谢谢你的回复。我已经在crontab中添加了它。SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/#run parts 01****root run parts/etc/cron.hourly 02 4***root run parts/etc/cron.daily 22 4**0 root run parts/etc/cron.weekly 42 4**root run parts/etc/cron.monthly***/op/wrd/send_mail.sh#我的脚本路径是这样的吗?如何正确我现在执行脚本吗?我的答案是针对您的个人crontab,您使用
crontab-e
更新它,而不是系统范围的
/etc/crontab
文件。