cron не запускает скрипт

Если это исполняемый jar, то

java -jar Minecraft.jar 

Не все jar-архивы содержат исполняемый класс, объявленный для запуска в файле манифеста, но если есть, это будет работать. [ ! d1]

Btw: Вы не запускаете большинство программ из оболочки с точкой. Точка - это ярлык для source, и он работает только в bash и некоторых других оболочках, чтобы включить скрипт в область текущего сеанса.

Скомпилированный двоичный xybin просто начинается с его имени, если он находится в пути:

xybin 

или, с его абсолютным путем:

/home/foo/proj/test/xybin
[d5 ] или с его относительным путем:

proj/test/xybin

или если вы попали в каталог файла с этим относительным путем:

./xybin

Файл должен быть (см. chmod). Все вышесказанное верно и для shellscripts, но у них часто есть расширение .sh, и вы можете запустить shellscript, вызвав интерпретатор, и тогда его не нужно отмечать как исполняемый файл:

 bash xy.sh

Если вы не хотите запускать новый bash, вы можете использовать источник, и вы это делаете, чтобы использовать определения функций, псевдонимы и параметры переменных.

1
задан 20 April 2018 в 18:02

3 ответа

55 * * * * ubuntu /home/ubuntu/scripts/dm-customer/etl-execution.sh

Почему у вас есть Ubuntu?

Формат: от man 5 crontab:

   The format of a cron command is similar to the V7 standard, with a num-
   ber  of upward-compatible extensions.  Each line has five time-and-date
   fields followed by a username (if this is the system crontab file), and
   followed  by  a  command.   Commands  are  executed by cron(8) when the
   'minute', 'hour', and 'month of the  year'  fields  match  the  current
   time, and at least one of the two 'day' fields ('day of month', or 'day
   of week') match the current time (see "Note" below).

Имя пользователя должно включаться только в том случае, если это система crontab. Если вы используете crontab -e как своего собственного пользователя, его не следует включать.

Попробуйте

55 * * * * /home/ubuntu/scripts/dm-customer/etl-execution.sh

и посмотрите, работает ли это.

1
ответ дан 22 May 2018 в 11:20
55 * * * * ubuntu /home/ubuntu/scripts/dm-customer/etl-execution.sh

Почему у вас есть Ubuntu?

Формат: от man 5 crontab:

The format of a cron command is similar to the V7 standard, with a num- ber of upward-compatible extensions. Each line has five time-and-date fields followed by a username (if this is the system crontab file), and followed by a command. Commands are executed by cron(8) when the 'minute', 'hour', and 'month of the year' fields match the current time, and at least one of the two 'day' fields ('day of month', or 'day of week') match the current time (see "Note" below).

Имя пользователя должно включаться только в том случае, если это система crontab. Если вы используете crontab -e как своего собственного пользователя, его не следует включать.

Попробуйте

55 * * * * /home/ubuntu/scripts/dm-customer/etl-execution.sh

и посмотрите, работает ли это.

1
ответ дан 17 July 2018 в 16:29
55 * * * * ubuntu /home/ubuntu/scripts/dm-customer/etl-execution.sh

Почему у вас есть Ubuntu?

Формат: от man 5 crontab:

The format of a cron command is similar to the V7 standard, with a num- ber of upward-compatible extensions. Each line has five time-and-date fields followed by a username (if this is the system crontab file), and followed by a command. Commands are executed by cron(8) when the 'minute', 'hour', and 'month of the year' fields match the current time, and at least one of the two 'day' fields ('day of month', or 'day of week') match the current time (see "Note" below).

Имя пользователя должно включаться только в том случае, если это система crontab. Если вы используете crontab -e как своего собственного пользователя, его не следует включать.

Попробуйте

55 * * * * /home/ubuntu/scripts/dm-customer/etl-execution.sh

и посмотрите, работает ли это.

1
ответ дан 23 July 2018 в 17:21

Другие вопросы по тегам:

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