1 votes

Is pobible to recover a deleted file with the command -r on a linux server?

I made a very serious error. I was editing the crontab file from my remote server, I was as root user and it turns out that I typed "crontab -r" instead of "crontab-e" and without prior notice simplemtne was removed. I was looking for information and it turns out that the files deleted with the-r command are not stored in some place like the recycle bin or something like that. I am very concerned already that there are scheduled backups and all the scripts that my hosting place. I already communicate with them and should I expect a response from a person specialized in a span of 24 to 48 hours, but I'm very procupado. Has anyone had a similar experience? it will be possible to recover that file?

2voto

crontab -r delete the single file that contains cron jobs.

Then, if there is no backup, the only thing you can do is:

  • In RedHat / CentOS, if your jobs have been triggered before, you can find the log cron in /var/log/cron. The file you will help rewrite the cron again.
  • Another option is to retrieve the file using a tool recovery of files. However, it is less likely that this to be successful, because the system partition is usually busy and is likely that the corresponding sectors have been overwritten.
  • In Unbuntu / debian, if your task runs before, try this: grep CRON/var/log/syslog

HolaDevs.com

HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by:

X