Here is the scenario;
I need to authorize a user to do activity in
/opt/dev-folder/. Developer makes frequent changes in file, some time they replaced or remove original file.
I have assigned privileges with sudo. Now i want some idea how can i take auto backup of file when developer run
rm -f file-name.
sudo rm -rf file-name.php
in background, it should do something like below :
mv file-name.php /backup/
any idea or better recommendation would be highly appreciated.