日別アーカイブ: 2008/12/04

CentOS5へのcrontabインストール

とあるプロジェクトにて、コンテンツバックアップ用のシェルを書いたので、それをcronに仕込もうとした時のお話。

バックアップシェルの動作検証も終わり、cron に仕込もうとしたところ・・・

[root@host ~]# crontab -l

-bash: crontab: command not found

。。。orz

他人が作ったサーバはキライです。

なので、crontab を使えるように。

[root@host ~]# yum install crontabs

Loading “installonlyn” plugin

Setting up Install Process

Setting up repositories

Reading repository metadata in from local files

Parsing package install arguments

Resolving Dependencies

–> Populating transaction set with selected packages. Please wait.

—> Downloading header for crontabs to pack into transaction set.

crontabs-1.10-8.noarch.rp 100% |=========================| 3.9 kB 00:00

—> Package crontabs.noarch 0:1.10-8 set to be updated

–> Running transaction check

Dependencies Resolved

=============================================================================

Package Arch Version Repository Size

=============================================================================

Installing:

crontabs noarch 1.10-8 base 5.0 k

Transaction Summary

=============================================================================

Install 1 Package(s)

Update 0 Package(s)

Remove 0 Package(s)

Total download size: 5.0 k

Is this ok [y/N]: y

Downloading Packages:

(1/1): crontabs-1.10-8.no 100% |=========================| 5.0 kB 00:00

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing: crontabs ######################### [1/1]

Installed: crontabs.noarch 0:1.10-8

Complete!

もいっちょ。

[root@host ~]# yum install vixie-cron

Loading “installonlyn” plugin

Setting up Install Process

Setting up repositories

Reading repository metadata in from local files

Parsing package install arguments

Resolving Dependencies

–> Populating transaction set with selected packages. Please wait.

—> Package vixie-cron.i386 4:4.1-72.el5 set to be updated

–> Running transaction check

Dependencies Resolved

=============================================================================

Package Arch Version Repository Size

=============================================================================

Installing:

vixie-cron i386 4:4.1-72.el5 base 91 k

Transaction Summary

=============================================================================

Install 1 Package(s)

Update 0 Package(s)

Remove 0 Package(s)

Total download size: 91 k

Is this ok [y/N]: y

Downloading Packages:

(1/1): vixie-cron-4.1-72. 100% |=========================| 91 kB 00:12

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing: vixie-cron ######################### [1/1]

Installed: vixie-cron.i386 4:4.1-72.el5

Complete!

確認。

[root@host ~]# crontab -l

no crontab for root

おk。

無事、crontab で、cron の設定が出来ましたとさ。

でわ。