Thursday, December 5, 2013
Membuat cron job pada linux centos 6
Install package dan dependencies
#yum install vixie-cron
Enable service saat booting and start
# /sbin/chkconfig crond on
Start or restart Service
# /etc/init.d/crond start
menambahkan cron job :
# vim /etc/crontab
tampilanya :
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
Tambahkan dibagian bawahnya :
30 10 * * * root rm /home/test/cron_data/test.txt
Simpan filenya = Esc +wq
Artinya : job ini bekerja setiap hari, setiap bulan, setiap tanggal 1-31 , jam 10 lebih 30 menit.
Reff lain silahkan baca :
http://kusprayitna.staff.uii.ac.id/2008/09/22/membuat-penjadwalan-di-linux-crontab/
http://blogbodi.wordpress.com/2012/02/19/crontab-auto-eksekusi-perintah-linux/
https://drupal.org/node/23714
Subscribe to:
Post Comments (Atom)
About Me
|
gak jelaas banget klu cron abis restart apa pertama x komputer nyala gimana
ReplyDelete