3

小心使用crontab-r

 3 years ago
source link: https://www.bboy.app/2021/08/10/%E5%B0%8F%E5%BF%83%E4%BD%BF%E7%94%A8crontab-r/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

小心使用crontab-r

发表于

2021-08-11 更新于 2021-08-14 分类于 linux

202108111435122.png

早上在更新定时任务的时候,本来准备打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

欢迎关注我的其它发布渠道


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK