কেন ক্রন টাস্ক দুইবার চালানো হয়?


1

আমার একটি কাজ আছে যা উবুন্টু 10.04 এ প্রতিদিন চালানো উচিত। তাই আমি crontab ব্যবহার করি এবং /etc/cron.daily ডিরেক্টরির মধ্যে টাস্ক স্ক্রিপ্ট কপি।

এখানে আমার crontab হয়:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
22 0    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
48 2    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 3    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

কিন্তু আমি দেখেছি যে /etc/cron.daily এ কাজ দুবার দৌড়ে! আমি জানি না কেন আমি সমস্ত প্রসেস তালিকাভুক্ত করার জন্য /etc/cron.daily এ একটি স্ক্রিপ্ট (প্রধানত pstree -a নামে) যুক্ত করেছি। এবং তারপর আমি দেখেছি যে আসলে দুটি ক্রন সাব-প্রসেস ছিল!

  |-cron
  |   |-cron
  |   |   |-(cron)
  |   |   `-sh -c test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
  |   |       `-run-parts --report /etc/cron.daily
  |   |           `-aa /etc/cron.daily/aa
  |   |               `-pstree -a
  |   `-cron
  |       |-(cron)
  |       `-sh -c root\011test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
  |           `-run-parts --report /etc/cron.daily
  |               `-aa /etc/cron.daily/aa
  |                   `-pstree -a

কেউ জানেন কেন ক্রন এখানে দুবার রান করে?


যে root\011test দ্বিতীয় প্রক্রিয়ার মধ্যে আমাকে মনে হয় crontab ফাইল কোনোভাবে দূষিত হয়।
— Der Hochstapler
আমাদের সাইট ব্যবহার করে, আপনি স্বীকার করেছেন যে আপনি আমাদের কুকি নীতি এবং গোপনীয়তা নীতিটি পড়েছেন এবং বুঝতে পেরেছেন ।
Licensed under cc by-sa 3.0 with attribution required.