Linux – /var/tmp and file lifetime

cronlinuxtmp

I've got a cronjob that runs every minute and checks existence of a certain file. If there's no such file, job silently ends. If there is a file, then another script is started. That script removes the file when done. Its execution time can take up to 20 minutes.

My questions are:
Are there any flaws in this scheme? Is it ok to store such file in tmp? Can I be shure that nothing will attempt to remove it?


Thanks for replies!

This scheme purpose is to allow to run that script through the web interface. Script itself is in user's home folder and works on its contents. I'm not sure if creating pid files in /var/run is appropriate.

Best Answer

I guess you speak of a Linux system. If you did not set up anything to clean up /tmp, it will not be done automatically. The only exception is when you reboot the system - most Linux distros clean up /tmp at reboot. Of course you can search for the script that does the celan up and you can disable it if this is a concern