Posted in 后勤仓库 定时任务中时间日期格式的写法 thinkwei 2024-07-31 Leave a Comment on 定时任务中时间日期格式的写法 在 crontab 中的时间或日期格式的写法需要转义 * * * * * echo $(date +"\%Y-\%m-\%d \%H:\%M:\%S" -d "-1day") >> ~/test.log 可根据自己需要灵活修改格式 记录下省的到处搜索 定时任务中日期格式不生效?date function not work with crontab ? Author: thinkwei