etc.

크론탭 튜토리얼

JinungKim 2021. 5. 17. 13:31

0. set up


# os: ubuntu:20.04

apt update
apt install -y cron
apt install -y systemctl

systemctl start cron

 

2. sample file


    파일명 test.sh

#!bin/sh
echo "Hello, World" > /tmp/crontab_test.txt

3. job 추가


아래 잡을 추가하면 1분 마다 /tmp/crontab_test.txt 파일에 Hello, World를 작성한다.

crontab -e

* * * * * sh /test.sh