Запланировать Cron только на неделю

Assuming that you want to be protected against other normal users of the system (if the adversary has root access, all bets are off), your could in principle use a secure attention key:

An operating system's Secure Attention Key is a security tool which is provided as protection against trojan password capturing programs. It is an undefeatable way of killing all programs which could be masquerading as login applications. Users need to be taught to enter this key sequence before they log in to the system.

(Linux 2.4.2 Secure Attention Key (SAK) handling, Andrew Morton, 18 March 2001)

This related U&L question may be of interest: How can I find the Secure Attention Key (SAK) on my system and can I disable it?

0
09.03.2018, 17:56
2 ответа

Это правильный способ запуска задания в дни с 1 по 5 (Воскресенье равно 0 (или 7 )). Кроме того, вы можете явно указать дни:

10 6 * * 1,2,3,4,5 java -jar /.../myproject.jar >> /../myjob.log 2>&1

Вы должны быть осторожны с добавлением ограничения "день месяца" (поле 3 ), кроме *; если указаны оба значения, то cron запустит задание, когда или поле совпадут.

3
28.01.2020, 02:18

Да, это выглядит правильно.

10 6 * * 1-5 java -jar /.../myproject.jar >> /../myjob.log 2>&1

Это запустит команду в 06 :10 (6:10 утра )каждый будний день (с понедельника по пятницу ).

1
28.01.2020, 02:18

Теги

Похожие вопросы