DEV Community

Cover image for Delete unrelated files post-use
Preetham
Preetham

Posted on

Delete unrelated files post-use

Now, I would say that it's good to clean up or remove unrelated files from the point of execution after its work is done. We do not want to think it is fairly safe to assume it won't cause any problems.

A very common task that has to be done after any plain VM or application VM (from an image) deployment is to perform post-deployment steps.

A general use-case would be to download the post-deployment script from any blob and perform the post-deployment script. We might even need to pass parameters to the post-deployment script. So we might assume that, as parameters need not be passed, the post-deployment script will not cause any problem. There might be many thousand other factors that might want you to think that there is no harm in this. What or who could even possibly run this again. But I have seen a scenario where it was executed again and that scenario cannot be recreated either.

So, Always prevention is better than cure.

So always delete any files(including scripts and configs) or folders after it has done its job brilliantly. At least archive them and store them in a different folder if you feel it might be needed again.

Please do add other similar scenarios or experiences to take note of in production to prevent breakdowns.

Photo Courtesy: https://unsplash.com/photos/jLtXXn7n16k

Top comments (0)