定时任务新增
This commit is contained in:
22
application/command/queryWechatArticleStatus.sh
Normal file
22
application/command/queryWechatArticleStatus.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# queryWechatArticleStatus.sh
|
||||
# 批量处理微信公众号草稿箱的AI文章已发布的文章状态
|
||||
# 调用接口获取前一天文章的记录
|
||||
# 此文件需要在crontab中配置每天【凌晨5:30】运行一次
|
||||
# @author chengxiaoling
|
||||
# @date 2025-05-22
|
||||
|
||||
# 基础配置
|
||||
DOMAIN="http://api.tmrjournals.com/public/index.php/" # 项目域名
|
||||
ROUTE="/api/Cronwechat/queryWechatArticleStatus" # 控制器路由
|
||||
BASE_PATH=$(cd `dirname $0`; pwd)
|
||||
# 如果日志目录不存在则创建
|
||||
logDir=${BASE_PATH}/log/$(date "+%Y")/$(date "+%m")
|
||||
if [ ! -d $logDir ];then
|
||||
mkdir -p $logDir
|
||||
fi
|
||||
|
||||
# 执行请求并记录日志
|
||||
curl "${DOMAIN}${ROUTE}" >> ${logDir}/queryWechatArticleStatus_$(date "+%Y%m%d").log 2>&1
|
||||
# 添加时间戳
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] 定时任务已执行" >> ${logDir}/queryWechatArticleStatus_$(date "+%Y%m%d").log
|
||||
Reference in New Issue
Block a user