Bboysoul's Blog

首页 公告 RSS

小心使用crontab-r

August 11, 2021 本文有 217 个字 需要花费 1 分钟阅读

简介

早上在更新定时任务的时候,本来准备打crontab -e的没想到手速过快,打在了旁边的r上,妈的jj定时任务全没了

操作

crontab -r 是删除定时任务,其实这个没必要写个博客,但是为了提醒自己,还是,,,,,,草

备份

可以使用git去备份你的crontab定时任务,首先创建一个仓库之后clone 到本地,然后添加下面命令到crontab

16 11 * * * crontab -l >/data/crontab/crontab && cd /data/crontab/ && git add . && git commit -m "update" && git push origin master

这样就会自动备份了

欢迎关注我的博客www.bboy.app

Have Fun


Tags:

本站总访问量 本站总访客数