中秋节快到了,首先祝自己中秋快乐。

昨天下午六点,心里正想着加完一个crontab就可以下班了。本来想执行 crontab -e的,没想到手一抖就输入了crontab ,然后就进入了下面这个样子。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAiUAAAArCAIAAAAomm/lAAADX0lEQVR4nO3d3ZHaMBSGYTfldlSNilEBW0CuVYsu6GBzYVlY1v+Cjw1+n8lMAsggTibnQ5aXTI/HY3rN78d68Y0DAAbEeaOMc865/gYtGQ9HEKuzN2vrjJJ+1bpZW+ecc5eb2AuuWGfg9pK8sXoupsjuWMlgOIhkqafpwn1QGfIGwLGG8ub7+E/2zlk9S5S73AfDKiOZSvmRhTJvmH8pb5S5UNvuD0XyBrigm+eN79KztjKJ0+yD/m8gumM9ItduZ22dMfuDxmWe259cvdCpNvIG+Gg3z5v9O5+m7Xoi0/oz94+Mn7V1RocD0pa4z5vodtJF/R1JSI1LWrm/w69vlOlo34X6LNPT4cH1iTZ5Fp57eUMqGbupcVK6XP2bdQYg7/Z5s/Q2a4xv5co8m+W2CSsTtTOtwpiR8UtvNM8b+5zYRccuYeJHZ22XWwfkzfrC3efTSvWZCif8Ni+4qUNUn2RSufVNvv7NOgOQd/O8WTvUrG19tdHX0pvjd60vHZXPG2WcW3/ffORfR3ZMLiwZnr08t5zZH2Gt7cub2hRyj8X3hVv1+jTPp3U+D4BTfEfe+OkXztpXDgwHPA/dbluEz+WV/YCh8dX1Suae4vhoXLOdztqsj6/TTV83N+Hea6Wr+yWZ6ZXeV70+2Un21J+8Aa7gO/Lmz0IHW/8Qt7T2+mZw/Oj6prR/k+5nZE5Zjahfn9bu129c3wzlTaH+rG+AC7p53oSPx9au+xXxpnO4VdifGBw/un/TvD4tf9C4zP6Nz2GjujZA6vs36dHl/Zty3mTmUag/+zfABWXzZvqKn+XskRYkutpJ7z+FpyuJsfGV66ay54XiVyg1zSOuT/vD9dDV69Pya73907fOg1WvXNvUn+vTgAvKfp/N8u/z7CyQQCNq7NFc6uc9AXy0+vd1nh0Hhyt8IseKvAHwLs3vhz47EY4lU2QAgM+bn59/2V/LmLND4UBnlh4AboW8AQBI6MkbAABeRd4AACSQNwAACeQNAEACeQMAkEDeAAAkkDcAAAnkDQBAAnkDAJBA3gAAJJA3AAAJ5A0AQAJ5AwCQ0Pz/bwAAeAPyBgAggbwBAEggbwAAEsgbAIAE8gYAIIG8AQBIIG8AABLIGwCABPIGACCBvAEASCBvAAASyBsAgID/bim+I3gu65oAAAAASUVORK5CYII=" alt="" />

一看不对劲,就随手按了 Ctrl + D。

接下来,恐怖的事情发生了,crontab的所有任务都被清空了。

查找资料发现如下:

如果遗漏了任何选项,crontab可能会打开一个空文件,或者看起来像是个空文件。这时敲delete键退出,不要按<Ctrl-D>,否则你将丢失crontab文件。 

此时我的心情是这样的

aaarticlea/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADcAWEDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoE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7H+R/xoA2aKxv7VuP7sf5H/Gj+1bj+7H+R/xoA2aaURvvKp+orI/tW4/ux/kf8aP7VuP7sf5H/GgDXEUa9EUfQU6sb+1bj+7H+R/xo/tW4/ux/kf8aANmisb+1bj+7H+R/wAaP7VuP7sf5H/GgDZorG/tW4/ux/kf8aP7VuP7sf5H/GgDZorG/tW4/ux/kf8AGj+1bj+7H+R/xoA2aKxv7VuP7sf5H/Gj+1bj+7H+R/xoA2aKxv7VuP7sf5H/ABo/tW4/ux/kf8aANmisb+1bj+7H+R/xo/tW4/ux/kf8aANmisb+1bj+7H+R/wAaP7VuP7sf5H/GgDZorG/tW4/ux/kf8aP7VuP7sf5H/GgDZorG/tW4/ux/kf8AGj+1bj+7H+R/xoA2aKxv7VuP7sf5H/Gj+1bj+7H+R/xoA2aKxv7VuP7sf5H/ABo/tW4/ux/kf8aANmisb+1bj+7H+R/xo/tW4/ux/kf8aANmisb+1bj+7H+R/wAaP7VuP7sf5H/GgDZorG/tW4/ux/kf8aP7VuP7sf5H/GgDZqK5/wCPWX/dNZf9q3H92P8AI/4019SnkRkKphhg4B/xoA2KKKKAP//Z" alt="" />

不过,自己删的crontab,跪着也要找回来。

皇天不负苦心人,办法还是有的。crontab有运行日志,在日志里面可以找到执行过的历史命令。前提是要有root权限。

命令如下:

cat /var/log/cron* | grep -i "`which cron`" > ./all_temp

cat  ./all_temp | grep -v "<command>" > ./cmd_temp

用awk读取cmd_temp,即可得到命令。

[script- tmp]$ cat cmd_temp  | grep username | awk -F 'CMD' '{print $2}' | sort | uniq

 (bash   /home/appadmin/script/security/auto_restart.sh)

命令是找回了,可是执行周期呢?还是靠cmd_temp。

[script- tmp]$ cat cmd_temp  | grep /home/appadmin/script/security/auto_restart.sh | head
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)
Sep :: script- CROND[]: (appadmin) CMD (bash /home/appadmin/script/security/auto_restart.sh)

可以很明显的看出,命令是一分钟一次。

全部恢复完成后已经是下班后一个小时了。不管怎么样,总算把自己坑填好了。

【crontab】误删crontab及其恢复的更多相关文章

  1. crontab误删操作的恢复与防范

    1.crontab -r 误删操作的恢复 语句解析:crontab -e 编辑 与 crontab -r 删除,由于e, r在键盘上是紧邻的,一旦误操作 crontab -r 将会删除每个用户的定时任 ...

  2. 在Linux下误删文件后恢复【转】

    针对日常维护操作,难免会出现文件误删除的操作.大家熟知linux文件系统不同win有回收站,删除后的文件可以到垃圾箱寻回,要知道linux文件修复比较费劲,网络上面的文档也是五花八门.所以本次研究一种 ...

  3. Mysql误删表中数据与误删表的恢复方法

    由于头两天面试时被问了这样一个问题,如果某同事误删了某个表,你该怎么恢复? 当时想了一下,因为博主没有遇到过这个问题,但是也多少了解一些,所以就回答通过mysql的binlog日志进行恢复. 面试官当 ...

  4. Oracle误删数据的恢复

    Oracle误删数据的恢复,分为两种方法:SCN和时间戳两种方法恢复. 一.通过SCN恢复删除且已提交的数据 1.获得当前数据库的SCN号 select current_scn from v$data ...

  5. crontab 误删恢复

    某台服务器某账号的 crontab 任务被清空,原因不明.同时,该服务器上的 crontab 任务备份未开启.故思考如何恢复 crontab 任务. 经查,CentOS 系统的 crontab 任务的 ...

  6. linux下rm -r误删NTFS文件恢复方法

    一时疏忽,手一抖,把整个挂载的F盘删了一半!顿时傻眼!! 被删的F盘是Windows下NTFS分区,在Ubuntu12.04中挂载了F盘,使用rm命令时粗心大意,误删了一半的数据. 血的教训告诉我们, ...

  7. 误删ext3的恢复方法

    1.Ext3文件系统结构的简单介绍在Linux所 用的Ext3文件系统中,文件是以块为单位存储的,默认情况下每个块的大小是1K,不同的块以块号区分.每个文件还有一个节点,节点中包含有文件所有者, 读写 ...

  8. 关于oracle误删数据的恢复

    与数据打交道,免不了会误删一些数据,之后还commit了,连回滚的机会都没了,而更糟糕的是你又没有备份,这种事终于在今天被我不幸的遇上了... 唯一一点值得欣慰的是,我删除表记录的时候,时间不长,一天 ...

  9. [转]oracle误删数据的恢复

    与数据打交道,免不了会误删一些数据,之后还commit了,连回滚的机会都没了,而更糟糕的是你又没有备份,这种事终于在今天被我不幸的遇上了... 唯一一点值得欣慰的是,我删除表记录的时候,时间不长,一天 ...

随机推荐

  1. IntelliJ IDEA将导入的项目转成maven项目

    今天导入公司的maven项目,发现结构不对劲,难怪说为啥一直不能部署tomcat,后面百度才了解到导入这个项目还不是maven项目,首先需要把这个项目变成maven项目,然后再进行tomcat的部署下 ...

  2. python 并发编程 多进程 生产者消费者模型介绍

    一 生产者消费者模型介绍 为什么要使用生产者消费者模型 生产者指的是生产数据的任务,消费者指的是处理数据的任务, 生产数据目的,是为了给消费者处理. 在并发编程中,如果生产者处理速度很快,而消费者处理 ...

  3. C语言课程程序设计

    项目名称和目标 项目为基于EasyX库的RPG游戏,目标能实现控制游戏主角自由移动,能与NPC对话交互. 我组目前还未确定具体项目名称 项目主体功能 项目的主体功能具有一个游戏所拥有的完整功能,包括但 ...

  4. [转帖]X86_64平台上利用qemu安装aarch64架构的虚拟机

    X86_64平台上利用qemu安装aarch64架构的虚拟机 https://blog.csdn.net/chenxiangneu/article/details/78955462 遇到原作者一样的问 ...

  5. linux中/etc/profile 和 ~/.bash_profile 的区别

    在 linux中设置环境变量一般使用bash_profile进行配置 其中/etc/bash_profile 表示系统整体设置 ,生效后系统内所有用户可用而 ~/.bash_profile 只表示当前 ...

  6. nodejs实现服务端重定向

    nodejs实现服务端重定向:https://www.jianshu.com/p/5a1500fcd713

  7. 为webService添加Interceptor(拦截器)

    今天写一个简单的拦截器,以webService接口为例: 背景:H5的一个项目,只要调用H5webService 接口下面的方法都会触发一个AuthorityInterceptor去验证是否调用类型是 ...

  8. 洛谷 P1273 有线电视网 题解

    题面 按照常见树形背包定义状态:设dp[u][j]表示在以u为根的子树中,选择j个客户所能获得的最大收益. 状态转移:dp[u][j]=max(dp[u][j-k],dp[v][k]-w(u,v)); ...

  9. linux 内核数据结构之红黑树.

    转载: http://www.cnblogs.com/haippy/archive/2012/09/02/2668099.html https://zh.wikipedia.org/zh/%E7%BA ...

  10. python变量的内存管理

    python变量的内存管理 一.变量存在了哪里? 先让我们来看一段代码: height = 100 # 定义变量 # print(100) # print会自动帮你创建一个变量100,打印完之后,马上 ...