定时任务

This commit is contained in:
chengxl
2025-12-29 14:57:25 +08:00
parent a951558f9b
commit 47594a9042
2 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#!/bin/bash
# agreeReviewReminder.sh
# 批量处理文章审稿阶段-同意审稿超过十天/十二天发送提醒邮件
# 调用接口获取需要提醒的审稿人记录
# 此文件需要在crontab中配置每天【凌晨0:30】运行一次
# @author chengxiaoling
# @date 2025-12-29
# 基础配置
DOMAIN="http://api.tmrjournals.com/public/index.php/" # 项目域名
# DOMAIN="http://zmzm.tougao.dev.com" # 项目域名
ROUTE="/api/Cronreview/agreeReminder" # 控制器路由
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}/agreeReminder_$(date "+%Y%m%d").log 2>&1
# 添加时间戳
echo "[$(date '+%Y-%m-%d %H:%M:%S')] 定时任务已执行" >> ${logDir}/agreeReminder_$(date "+%Y%m%d").log

View File

@@ -0,0 +1,23 @@
#!/bin/bash
# inviteReviewReminder.sh
# 批量处理文章审稿阶段-邀请审稿超过三天/五天发送提醒邮件
# 调用接口获取需要提醒的审稿人记录
# 此文件需要在crontab中配置每天【凌晨0:30】运行一次
# @author chengxiaoling
# @date 2025-12-29
# 基础配置
DOMAIN="http://api.tmrjournals.com/public/index.php/" # 项目域名
# DOMAIN="http://zmzm.tougao.dev.com" # 项目域名
ROUTE="/api/Cronreview/inviteReminder" # 控制器路由
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}/inviteReminder_$(date "+%Y%m%d").log 2>&1
# 添加时间戳
echo "[$(date '+%Y-%m-%d %H:%M:%S')] 定时任务已执行" >> ${logDir}/inviteReminder_$(date "+%Y%m%d").log