The Mid-Autumn Festival is coming, first of all wish yourself a happy mid-autumn.
Yesterday six o'clock in the afternoon, the heart is thinking of adding a crontab can work. Originally wanted to execute CRONTAB-E, did not think of hand shake on the input of crontab, and then entered the following look.
When you see something wrong, press Ctrl + D.
Then, the horrible thing happened and all the crontab's tasks were emptied.
Find data found below:
That's what I'm feeling right now.
However, he deleted the crontab, on his knees to find back.
Emperor do not bear the painstaking people, the way is still there. Crontab has a running log, which allows you to find the history commands that have been executed in the log. The prerequisite is to have root privileges.
The command is as follows:
CAT/var"' which cron '" >./all_temp cat . " <command> " >./cmd_temp
The command can be obtained by reading Cmd_temp with awk.
[script- tmp]$ cat cmd_temp 'cmd'{print $} ' | Sort | uniq (bash /home/appadmin/script/security/auto_restart.sh)
The order was retrieved, but the execution cycle? Still rely on the cmd_temp.
[script- Genevatmp]$ Cat Cmd_temp | grep/home/appadmin/script/security/auto_restart.sh |Head Sep One Geneva: -: onscript- Genevacrond[18487]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva: $: onscript- Genevacrond[18522]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva: $: onscript- Genevacrond[18844]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva: -: onscript- Genevacrond[18870]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva: -: onscript- Genevacrond[18901]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva: the: onscript- Genevacrond[19036]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva: -: onscript- Genevacrond[19073]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva:Wuyi: onscript- Genevacrond[19147]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva: the: onscript- Genevacrond[19286]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh) Sep One Geneva: -: onscript- Genevacrond[19312]: (appadmin) CMD (bash/home/appadmin/script/security/auto_restart.sh)
It can be seen clearly that the command is a minute at a time.
After all, it's one hours after work. Anyway, I finally filled out the pit.
"Crontab" mistakenly deleting crontab and its recovery