Cron job

cron job ဆိုတာ windows မှာ schedule နဲ့ အတူတူပါပဲ။ cron job က မတူတဲ့အပိုင်းကတော့ cron file ရေးရတာပဲ။ သူ့ format က ဒီလိုရေးပါတယ်။

minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command

ဥပမာ

01 04 1 1 1 /usr/bin/somedirectory/somecommand

အမြဲတန်းဆိုရင်တော့ * ကို အသုံးပြုနိုင်ပါတယ်။

01 04 * * * /usr/bin/somedirectory/somecommand

အဲဒါက every day,every month, every week လို့ပြောလိုက်တာပါ။

cron job ကို အသုံးပြုဖို့ crontab ဆိုတဲ့ command line နဲ့ အသုံးပြုတယ်။

$crontab filename Add by file name
$crontab -e Edit in comand line Editor
$crontab -l Cron List
$crontab -r Remove

command ကို sh file အနေနဲ့ အသုံးပြုလို့ရပါတယ်။

cron job ကို အထူးသဖြင့် backup လုပ်တဲ့နေရာတွေမှာ အသုံးပြုတတ်ကြပါတယ်။ Unix like system တွေအတွက် အလွန်ကို အသုံးဝင်ပါတယ်။

One thought on “Cron job

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>