My colleague ran grep | crontab. After that all jobs disappeared. Looks like he was trying to run crontab -l. So what happened after running the command grep | crontab? Can anyone explain?
Can grep | crontab destroy all jobs?
cron
crontab can install new crontab for the invoking user (or the mentioned user as root) reading from STDIN. This is what happended in your case.grep without any option will generate an error message on STDERR as usual and you are piping the STDOUT of grep to STDIN of crontab which is blank hence your crontab will be gone.