我有包含xml文件的文件夹。文件夹的内容(插入的新xml文件)每天更新为N个文件。我想编写java程序,它将从文件夹中获取最新的文件,并对这些文件执行一些操作。我有两种方法:
Run java application every t minutes with cronjob.
或
Multithreaded java application which is run as daemon.
哪个会更有效率?或者任何能帮上忙的想法。
应用程序应该在Linux上运行。
我有使用CMD ["cron","-f"]命令运行cron的对接器。这会将输出写入cron日志文件。
是否有任何方法将这些日志重定向到控制台。
我的基本形象就像
FROM ubuntu:latest
RUN ls
RUN apt-get update
RUN apt install -y software-properties-common
RUN add-apt-repository -y ppa:openjdk-r/ppa
RUN apt-get update
RUN apt-get install -y openjdk-12-jre
RUN apt-g
我在/home/luis中有两个脚本,这是一个拥有管理员权限的用户。一个是.sh,另一个是我试图执行的ruby代码,以便在同一文件夹中生成一个txt文件。 linux_users.rb class User
attr_reader :username, :home_directory
def initialize(username, home)
@username = username
@home_directory = home
end
end
unix_users = []
File.open('/etc/passwd').readlines
我使用express环境创建了一个nodejs文件,并使用nodemon在服务器上运行该文件。目前,我必须向接口发出命令才能在nodemon上运行特定的文件,但我目前需要的是调度任务,以便在一天内在多个场合自动在服务器上运行该文件。
我的文件在终端上是这样的::
nodemon example_api.js
输出终端:
root@*********:/var/www/example project# nodemon example_api.js
[nodemon] ##.##.#####
[nodemon] to restart at any time, enter `rs`
[nod
我在我的Linux机器中使用这个脚本查找昨天修改的所有文件:
#!/bin/bash
find /home/*/domains/*/public_html/ -name "*.php" -mtime -1 | while read line; do
echo "$line"
done
当我手动运行脚本时,脚本可以正常工作,但是如果我从cron运行它,则会失败,并出现下面的错误:
find: `/home/*/domains/*/public_html/': No such file or directory
分发: Centos 5
克伦:
#DO N