LoginSignup
4
3

More than 3 years have passed since last update.

RancherOS や Barge で cron を動かす

Last updated at Posted at 2016-12-13
  • CoreOS には (busyboxがないため) crond がない。
  • @rebootは使えないので注意

RancherOS

  • 0.8-rc2 で確認
スケジュール保存場所の用意
mkdir -p /home/crontabs /var/spool/cron
ln -s /home/crontabs /var/spool/cron/crontabs
/sbin/crond
cronの設定
$ crontab -e
* * * * * date >> /tmp/a.txt
tail -F /tmp/a.txt
rancher.yml
ssh_authorized_keys:
- ssh-rsa AAA...

network:
  dns:
    nameservers:
    - 8.8.8.8
    - 8.8.4.4

write_files:
- content: |+
    #!/bin/bash
    mkdir -p /home/crontabs /var/spool/cron
    ln -s /home/crontabs /var/spool/cron/crontabs
    /sbin/crond
    #wait-for-docker
    #docker run -d nginx
  owner: root
  path: /etc/rc.local
  permissions: "0755"
merge
sudo ros config merge < rancher.yml
sudo ros config export

Barge

  • すでにcrondが動いている。

busybox crontab -e
sudo busybox crond

4
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3