LoginSignup
0
0

More than 1 year has passed since last update.

lightsail amazonlinux2 で cron

Posted at

さぁ、cronを動かそう。

といっても最初から動いているので、テスト設定するだけ。

cron.txt
MAILTO=your@email.com
#SHELL=/bin/sh
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin


# cron
* * * * * cd / >> /dev/null 2>&1

デバッグなので適当に。

2,3分経過したら cron が動いているか確認

tail /var/log/cron

Apr 21 14:45:01 ip-172-26-5-92 CROND[18641]: (root) CMD (cd />> /dev/null 2>&1)
Apr 21 14:46:01 ip-172-26-5-92 CROND[18720]: (root) CMD (cd />> /dev/null 2>&1)

OK

0
0
0

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
0
0