Crontab在Linux中运行Java文件 [英] Crontab in linux run java file

查看:246
本文介绍了Crontab在Linux中运行Java文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,所有
我在/home/my_name/java.sh中编写了一个脚本文件:

#!/bin/bash
java -jar/jar_location/file.jar


结束下一个我设置 chmod 775 java.sh

最后,我在/var/spool/cron/crontabs中写了一个crontab文件
crontab -e
0 15 * * */home/my_name/java.sh

每天15小时运行我的Java文件

我重新启动了crond deamon/etc/init.d/cron restart
我使用linux debian服务器.

但是它没有用,有人可以帮助我解决它吗?

谢谢!

Hi, All
I wrote a script file in /home/my_name/java.sh :

#!/bin/bash
java -jar /jar_location/file.jar


end next i set chmod 775 java.sh

end then i wrote a crontab file in /var/spool/cron/crontabs
crontab -e
0 15 * * * /home/my_name/java.sh

to run my java file at 15 hourly every day

i restarted crond deamon /etc/init.d/cron restart
i use linux debian server .

but it did not work , Can any body help me to resolve it ?

thank !

推荐答案

检查cron日志文件.您可以在/var/log 中使用文件名cron,cron.1,cron.2等找到它们.
您(或其他任何人)可能已经改变了配置方式,将文件存储在其他位置.在这种情况下,请选中/etc/syslog.conf.

祝你好运!
Check the cron log files. You can find them in /var/log with filename cron, cron.1, cron.2, etc... Surely you find the reason there.

You (or anyone else) could have changed the condiguration to store the files somewhere else. Check /etc/syslog.conf in this case.

Good luck!


这篇关于Crontab在Linux中运行Java文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆