diff --git "a/\351\231\210\345\277\227\344\274\237/20240617 \345\221\250\346\234\237\344\273\273\345\212\241\347\256\241\347\220\206.md" "b/\351\231\210\345\277\227\344\274\237/20240617 \345\221\250\346\234\237\344\273\273\345\212\241\347\256\241\347\220\206.md" new file mode 100644 index 0000000000000000000000000000000000000000..2403c2a64c2823e47b564c8d0aa37ac1817fdcc1 --- /dev/null +++ "b/\351\231\210\345\277\227\344\274\237/20240617 \345\221\250\346\234\237\344\273\273\345\212\241\347\256\241\347\220\206.md" @@ -0,0 +1,118 @@ +## 周期任务练习 + +执行在家目录touch a.txt + +1. 每天3:00执行一次 + + ```bash + 0 3 * * * /home/user/student01/a.txt + ``` + +2. 每周六2:00执行 + + ```bash + 0 2 * * 6 /home/user/student01/a.txt + ``` + +3. 每周六1:05执行 + + ```bash + 5 1 * * 6 /home/user/student01/a.txt + ``` + +4. 每周六1:25执行 + + ```bash + 25 1 * * 6 /home/user/student01/a.txt + ``` + +5. 每天8:40执行 + + ```bash + 40 8 * * * /home/user/student01/a.txt + ``` + +6. 每天3:50执行 + + ```bash + 50 3 * * * /home/user/student01/a.txt + ``` + +7. 每周一到周五的3:40执行 + + ```bash + 40 3 * * 1-5 /home/user/student01/a.txt + ``` + +8. 每周一到周五的3:41开始,每10分钟执行一次 + + ```bash + 41/10 3 * * 1-5 /home/user/student01/a.txt + ``` + +9. 每天的10:31开始,每2小时执行一次 + + ```bash + 31 10/2 * * * /home/user/student01/a.txt + ``` + +10. 每周一到周三的9:30执行一次 + + ```bash + 30 9 * * 1-3 /home/user/student01/a.txt + ``` + +11. 每周一到周五的8:00,每周一到周五的9:00执行一次 + + ```bash + 0 8,9 * * 1-5 /home/user/student01/a.txt + ``` + +12. 每天的23:45分执行一次 + + ```bash + 45 23 * * * /home/user/student01/a.txt + ``` + +13. 每周三的23:45分执行一次 + + ```bash + 45 23 * * 3 /home/user/student01/a.txt + ``` + +14. 每周一到周五的9:25到11:35、13:00到15:00之间,每隔10分钟执行一次 + + ```bash + 25/10 9-11:35 * * 1-5 /home/user/student01/a.txt + */10 13-15 * * 1-5 /home/user/student01/a.txt + ``` + +15. 每周一到周五的8:30、8:50、9:30、10:00、10:30、11:00、11:30、13:30、14:00、14:30、5:00分别执行一次 + + ```bash + 50 8 * * 1-5 /home/user/student01/a.txt + 30 8-11,13-14 * * 1-5 /home/user/student01/a.txt + 0 5,10-11,14 * * 1-5 /home/user/student01/a.txt + ``` + +16. 每天16:00、10:00执行一次 + + ```bash + 0 10,16 * * * /home/user/student01/a.txt + ``` + +17. 每天8:10、16:00、21:00分别执行一次 + + ```bash + 10 8 * * * /home/user/student01/a.txt + 0 16,21 * * * /home/user/student01/a.txt + ``` + +18. 每天7:47、8:00分别执行一次 + + ```bash + 47 7 * * * /home/user/student01/a.txt + 0 8 * * * /home/user/student01/a.txt + ``` + + \ No newline at end of file