Linux Crontab ¶
其實根本沒有要打甚麼教學,僅僅是紀錄一些指令罷了
排程狀態 ¶
sudo service cron status
啟動排程 ¶
sudo service cron start
關閉排程 ¶
sudo service cron stop
查閱 crontab 的工作內容 ¶
crontab -l
編寫排程 ¶
vim crontab
或
crontab -e
撰寫方式 ¶
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
# 每分鐘執行 index.php 一次
* * * * * php index.php
強力推薦 ¶
Other Command ¶
回到上一次目錄 ¶
cd -
就是回到剛剛的資料夾
假設原本在 /home/frank
下了指令
cd /etc
跑到 /etc 了
再下指令
cd -
就回到 /home/frank
工作管理員 ¶
ps aux
可搭配 grep
ps aux | grep php
最近聯絡到好久不見的朋友了,雖然她還在美國,聊了一下天感覺還是不錯低