crontab
प्रोसेस और सिस्टम
इस्तेमाल
crontab -e | crontab -lप्रति-उपयोगकर्ता समय-सारणी संभालता है; cron लगभग खाली PATH के साथ चलता है और लॉगिन प्रोफ़ाइल कभी नहीं पढ़ता, इसलिए पूर्ण पथ लिखें — और `crontab -r` पूरी तालिका बिना पूछे मिटा देता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -e | Edit your table in $EDITOR; it is installed when you save. |
| -l | Print your table. Redirect it somewhere to keep a backup. |
| -r | Delete the whole table at once, with no confirmation. |
| -u <user> | Work on another user's table (root only). |
| m h dom mon dow | The five time fields, then the command. * means every. |
| @reboot / @daily | Shorthand instead of the five fields. |
उदाहरण
crontab -l > ~/cron.bakBack up the table before touching it.
crontab -eThen add: 0 3 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
crontab -l | grep -v backup.sh | crontab -Remove one line without opening an editor.
क्या चल रहा है और क्या मशीन खा रहा है। मारने से पहले पहचानना क्रम है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. crontab क्या करता है?
प्रति-उपयोगकर्ता समय-सारणी संभालता है; cron लगभग खाली PATH के साथ चलता है और लॉगिन प्रोफ़ाइल कभी नहीं पढ़ता, इसलिए पूर्ण पथ लिखें — और `crontab -r` पूरी तालिका बिना पूछे मिटा देता है।
Q. इसे कैसे लिखें?
crontab -e | crontab -l — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 6 दिए हैं; पूरी सूची man crontab में है। यह कमांड प्रोसेस और सिस्टम में आती है।
मिलती-जुलती कमांड
man पेज: man crontab