В PuTTY я ввожу команду
crontab -e
Запускаеться Запускается редактор файла. Он мне неудобен
, и тогда по ssh я нахожу этот файл
; он висит в
/tmp/crontab.3kSN0S/crontab. Странно
, но как мне показалось
что этот фай
л в данный момент
времени запущен и работает. Может я и ошибаюсь. Я
новичек новичок, и всех тонкостей еще не познал. Я открываю текстовым редактором (я пользуюсь notepaad++) мне так удобней.
Вот что там внутри:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
насколько я понял, команды нужно в него и
впихнуть внести.0 0 * * * /usr/bin/java -Dfile.encoding=UTF8 -server -jar /srv/tankionline/server.jar
1 0 * * * /usr/bin/java -Dfile.encoding=UTF8 -server -jar /srv/tankionline/securityServer.jar
Вопрос
: # ставить в начале
строки, или не нужно
?Не сочтите за глупые вопросы
, но
погуглив
, я не
нашол нашёл ответы на свои вопросы. И как я понял
, что нужно учиться на вот таких банальных вопросах.
Я сделал так:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
#0 0 * * * /usr/bin/java -Dfile.encoding=UTF8 -server -jar /srv/tankionline/server.jar
#1 0 * * * /usr/bin/java -Dfile.encoding=UTF8 -server -jar /srv/tankionline/securityServer.jar
Пользователь добавил сообщение 08 Января 2020, 07:47:03:
С редактором внешним не вышло
.Пришлось редактировать на
внутренем внутреннем. Всё сохранил, и получилось. Как теперь все это проверить?
Пользователь добавил сообщение 08 Января 2020, 07:52:41:
В интернете из примеров я понял что
# нужно убрать (это своего рода
комент комментарий)
Пользователь добавил сообщение 08 Января 2020, 07:56:29:
Получилось так:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
0 0 * * * /usr/bin/java -Dfile.encoding=UTF8 -server -jar /srv/tankionline/server.jar
1 0 * * * /usr/bin/java -Dfile.encoding=UTF8 -server -jar /srv/tankionline/securityServer.jar
Еще вопрос
: как настроить лог всех этих подключений
?Допустим
, у меня есть папка
/srv/log/
Как там создать текстовый документ
, и туда записывать все удачные и неудачные подключения ранее описаных команд?
Правила форума
1.4. Листинги и содержимое текстовых файлов следует добавлять в сообщение с помощью тегов [spoiler]...[/spoiler] или [code]...[/code], либо прикреплять к сообщению в виде отдельного файла. Длинные гиперссылки следует оформлять при помощи тега [url=]...[/url]
Сообщение отредактировано. Добавлены теги, убраны пустые строки.
--zg_nico
Правила форума
2. На форуме ЗАПРЕЩЕНО
2.9. Намеренно искажать слова, а так же использовать жаргон. Цените культуру речи. Неумение общаться на своём языке никого не красит. Кроме того постарайтесь не допускать грамматических и синтаксических ошибок.
+5% с уведомлением в ЛС (т.к. автор предупрежден, и предупреждение проигнорировал). Исправлена речь, вставлены запятые, вопросительные знаки, модифицировано форматирование.
--zg_nico