# A Function Without local Overwrote My Variable and rm -rf Deleted the Wrong Directory
📰 Medium · DevOps
Learn how a function without local variables can overwrite external variables and how to avoid rm -rf disasters in deploy scripts
Action Steps
- Write deploy scripts with caution and test them thoroughly before running in production
- Use local variables in functions to avoid overwriting external variables
- Configure scripts to handle errors and exceptions properly
- Test rm -rf commands in a safe environment before running them in production
- Implement backup and restore mechanisms to recover from potential data loss
Who Needs to Know This
DevOps engineers and developers can benefit from this article to improve their scripting skills and avoid common pitfalls
Key Insight
💡 Using local variables in functions and testing scripts thoroughly can prevent common pitfalls in deploy scripts
Share This
💡 Be careful with deploy scripts! A function without local variables can overwrite external variables and rm -rf can delete the wrong directory #DevOps #deploymentscripts
Key Takeaways
Learn how a function without local variables can overwrite external variables and how to avoid rm -rf disasters in deploy scripts
Full Article
The deploy script had been running in production for four months without a problem. It built releases into a temp directory, ran some… Continue reading on Medium »
DeepCamp AI