当前位置: 首页 > Linux

linux定时任务输出时间

时间:2023-04-06 18:39:15 Linux

有时候会测试定时任务看执行情况,需要输出当前执行时间。如果不熟悉,时间格式容易搞错,输出错误会是crontab-uapache-e*****echo"11_$(date'+\%Y_\%m_\%d\%H:\%M:\%S')">>/data/www/xxxx/storage/logs/cron.txt效果