Thuta Learning
ရှာဖွေရန်
ExercisesHardwarebeginner

Practice: Linux/Software Setup Challenges

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Practice: Linux/Software Setup Challenges ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် hardware wiring/code ကို run ကြည့်တတ်မယ်
  • Real project ထဲမှာ ဒီ concept ကို ချက်ချင်း အသုံးချတတ်မယ်

ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်

ဒီ practice set က difficulty ပိုမြင့်ပါတယ် — SSH remote setup, systemd service, web dashboard concept တွေကို တစ်ခါတည်း ပေါင်းသုံးရမယ့် task များပါ။

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

Task ၂ ခု — (1) Auto-Start Web Dashboard: 'Setting Up a Web Server on Pi' lesson ရဲ့ Flask app ကို 'Running Services on Boot' lesson ရဲ့ systemd pattern ဖြင့် boot-on-start service အဖြစ် ပြောင်းရေးကြည့်ပါ (service file ရေး, enable, Pi restart ပြီးလည်း dashboard auto-run ဖြစ်ကြောင်း confirm), (2) Remote Backup Script: temp_log.csv ဖိုင်ကို ပုံမှန် (daily) computer ဆီ rsync ဖြင့် backup ယူတဲ့ shell script ရေးပြီး, Linux tutorial ရဲ့ cron lesson ကို ပြန်ကြည့်ပြီး daily schedule ချကြည့်ပါ။

အတူတူ ကြည့်မယ်

bash
# Task 2 hint — cron entry for daily backup at 2am
# crontab -e ထဲမှာ ထည့်ရမယ့် line:
0 2 * * * rsync -avz /home/pi/temp_log.csv user@backup-computer:/backups/
You should see
Task ၂ ခုစလုံးအတွက် Pi restart ပြီးလည်း automatic ဆက်အလုပ်ဖြစ်နေတဲ့ system ကို ပြီးမြောက်မည်။

၅ မိနစ် စမ်းကြည့်

Task ၂ ခုကို ကိုယ်တိုင် implement လုပ်ကြည့်ပါ — Linux tutorial ရဲ့ systemd/cron lesson ၂ ခုကို reference အဖြစ် ပြန်ဖွင့်ကြည့်ပါ။

သတိလေးတစ်ချက်

Cron job ကို run ခင် terminal မှာ ကိုယ်တိုင် test run လုပ်ပြီးမှ crontab ထဲ ထည့်ပါ — Linux tutorial ရဲ့ cron warning အတိုင်း cron environment က terminal environment နဲ့ variable ကွာနိုင်ပါတယ်။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Task 1 မှာ systemd service ကို enable လုပ်ရုံပဲ လုပ်ပြီး start မလုပ်ဘဲ ချန်ထားခြင်း (Linux tutorial ရဲ့ enable vs start ကွာခြားချက်ကို ပြန်သတိရပါ)
  • Task 2 မှာ cron job ကို run ခင် rsync command ကို terminal ကနေ manual test မလုပ်ဘဲ crontab ထဲ ချက်ချင်းထည့်ခြင်း

အခု ကိုယ်တိုင် စမ်းကြည့်

Task ၂ ခုကို ကိုယ်တိုင် implement လုပ်ကြည့်ပါ — Linux tutorial ရဲ့ systemd/cron lesson ၂ ခုကို reference အဖြစ် ပြန်ဖွင့်ကြည့်ပါ။

You'll know it worked when: Task ၂ ခုစလုံးအတွက် Pi restart ပြီးလည်း automatic ဆက်အလုပ်ဖြစ်နေတဲ့ system ကို ပြီးမြောက်မည်။

Practice: Linux/Software Setup Challenges | Thuta Learning