CI4 runs scheduling on Ubuntu with crontab

Mario tsai
Mar 26, 2024

php 跑排程更新資料

最近做物流,有需要更新資料庫的需求。

用排程做,才不會累。

使用套件

在Ubuntu中

啟用crontab 服務

sudo /etc/init.d/cron start

編輯 crontab

crontab -e

設定 早上七點跑一次 sh檔案

00 07 * * * sh /cronScript.sh

#! bin/bash
source /etc/profile
source ~/.bash_profile

cd /php_backend && php spark cronjob:run

ps 記得根目錄

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Mario tsai
Mario tsai

Written by Mario tsai

Major in physical education. Football referee. And high interest in looking the world through the numbers.

No responses yet

Write a response