Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crontab problem in main branch #140

Merged
merged 1 commit into from
Sep 20, 2023
Merged

fix crontab problem in main branch #140

merged 1 commit into from
Sep 20, 2023

Conversation

helenwangjia
Copy link
Contributor

Close #139

問題の原因:
docker-compose.yml中にcrontab /root/crontabが実行できなかったです。
実行できなかった原因がnew crontab file is missing newline before EOF, can't install.です。

解決方法:
crontabファイルに空行を追加しました。

テスト:
OsecT20で改めてビルドして、コンテナに入って、crontab -lを実行して、反映できました。

Successfully built fd2eaad7ca87
Successfully tagged cron:comtest01-sensor-recovery
sectu@sensor:~/osect_sensor$ docker exec -it osect_sensor_edge_cron_1 bash
root@sensor:/home/work# crontab -l
@reboot /bin/bash -c 'echo export RANDOM_TIME=$(($RANDOM\%3600)) >> /root/.profile'
@reboot /opt/ot_tools/suricata_update.sh > /dev/null 2>&1
* * * * * /opt/ot_tools/suricata_cron.sh dummy1 > /dev/null 2>&1
* * * * * /opt/ot_tools/p0f_cron.sh dummy1 > /dev/null 2>&1
* * * * * /opt/ot_tools/yaf_cron.sh dummy1 > /dev/null 2>&1
@reboot /usr/local/zeek/bin/zeekctl deploy
* * * * * /usr/local/zeek/bin/zeekctl cron
* * * * * sleep 5; /opt/ot_tools/ot_cron.sh > /dev/null 2>&1
0 * * * * /opt/ot_tools/complete_to_archives.sh > /dev/null 2>&1
0 1 * * * /bin/bash -c 'source /root/.profile; sleep $RANDOM_TIME'; /opt/ot_tools/suricata_update.sh > /dev/null 2>&1

@helenwangjia helenwangjia changed the title fix crontab problem fix crontab problem in main branch Sep 20, 2023
@takuma0121 takuma0121 merged commit 1ba7c1b into main Sep 20, 2023
4 checks passed
@takuma0121 takuma0121 deleted the fix-crontab branch September 20, 2023 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

コンテナ内にcrontabがない
2 participants