1. Proposed title of this feature request
Provide a confirmation dialog or backup solution for `crontab -r`
3. What is the nature and description of the request?
When executing 'crontab -r' by accident, the whole crontab is cleared with no easy way of recovery. This could easily happen, as 'e' is near located of 'r' on the keyboard.
4. Why does the customer need this? (List the business requirements here)
To prevent cleaning the crontab by accident, there should be some kind of preventive tasks.
5. How would the customer like to achieve this? (List the functional requirements here)
Provide a confirmation dialog or backup the old crontab before clearing it.
6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
confirmation dialog: Executing `crontab -r`, the user should be asked to confirm this action
backup crontab: after executing `crontab -r`, the user should be able to recover the old crontab easily
7. Is there already an existing RFE upstream or in Red Hat Bugzilla?
8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?
9. Is the sales team involved in this request and do they have any additional input?
10. List any affected packages or components.
11. Would the customer be able to assist in testing this functionality if implemented?
"crontab" already provides an interactive mode to ask for removal by adding "-i" to the command.
What about defaulting to be interactive by using an alias "crontab='crontab -i'" as this is already done with "rm"?
# grep rm /root/.bashrc
alias rm='rm -i'
# rpm -qf /root/.bashrc
If that would have to be applied to any user, the changes would need to go into /etc/skel/.bashrc
# rpm -qf /etc/skel/.bashrc
From what I read, changing the default behavior of "crontab" to ask on removal would break scripts - ok. But with that alias this shouldn't be the case - if a script fails because it's calling the alias, the fix would be to call /usr/bin/crontab directly. But this must have been the same migration as with the introduction of the "rm" alias.