上运行的EC2实例EC2-运行罐子罐子、实例

由网友(满城风絮)分享简介:我有一个EC2实例和我有一个的.jar,我已经从S3拿了(wget的脚本命令)。我要运行这个.jar文件,而不是在启动时,就在我决定的。I have an EC2 instance and i have a .jar that i already took (wget script command) from S3...

我有一个EC2实例和我有一个的.jar,我已经从S3拿了(wget的脚本命令)。 我要运行这个.jar文件,而不是在启动时,就在我决定的。

I have an EC2 instance and i have a .jar that i already took (wget script command) from S3. I want to run this .jar file, but not on start-up, just when i decide.

我使用的Java与日蚀朱诺与AWS SDK帮助。

I'm using Java with "Eclipse Juno" with help from AWS SDK.

运行用户数据脚本不帮我在这里。

Running a user data script doesn't help me here.

可以有一个人帮助我?

在此先感谢。

推荐答案

您要找的是UNIX cronjobs, 看看在cron作业手册中的这里并将其设置为,只要你想运行。

What you are looking for is unix cronjobs, take a look at the cron job manual here and set it to run whenever you want.

此外,您还可以在系统上安装 WEBMIN ,它给你一个巨大的服务器管理,包括cronjobs和计划命令你通过网页界面需要

also, you can install WEBMIN on your system, it gives you a great server management including cronjobs and scheduled commands as you need via web interface

如果你想运行的东西用java,只要使用

if you want to run something with java, just use

String[] command={"java","-jar","myfile.jar"};
Runtime.getRuntime().exec(command);
阅读全文

相关推荐

最新文章