Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cronsun执行脚本和crontab中命令有什么区别 #14

Closed
melpozhang opened this issue May 27, 2017 · 3 comments
Closed

cronsun执行脚本和crontab中命令有什么区别 #14

melpozhang opened this issue May 27, 2017 · 3 comments

Comments

@melpozhang
Copy link

我测试了下cronsun添加任务使用 >> 重定向输出会报错,不是很清楚其中实现原理,请教一下

@miraclesu
Copy link
Collaborator

miraclesu commented May 27, 2017

  1. 目前只支持 命令 + 参数... 这种形式,如果需要重定向,可以写一个脚本,在脚本里重定向,把这个脚本(加上执行权限)做为一个任务即可。
  2. 原理是在程序里启动一个子进程运行,然后执行任务

@melpozhang
Copy link
Author

后期考虑支持么, 因为像重定向以及管道之类的用的还是蛮多的,有些简单的任务写个脚本再添加任务还是有些许麻烦

@miraclesu
Copy link
Collaborator

  1. 暂时没有计划,这样做可操作太多,不是很安全
  2. 可以增加一个同步脚本任务,这样可以在源机器上写好脚本,然后执行一次这个同步任务,即可把新的脚本同步到目标结点,再增加新脚本做为任务即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants