0

Why does a folder created by an application in /var directory on Unix gets deleted on application restart ?

My app creates a folder in side var directory and write a file to it as /var/myAppName/.txt.. but on appp restart th is folder is deleted and I loose the file

Where to write so that folder is not deleted

sammy
  • 31
  • 3
  • Maybe you can check [this](https://serverfault.com/questions/377348/when-does-tmp-get-cleared) Some system will delete temp dir after reboot. – Ziv May 24 '23 at 14:18
  • Please add a minimal reproducible example as explained in the help center page: http://stackoverflow.com/help/minimal-reproducible-example. It is not clear how the application is creating and using the file. – aled May 24 '23 at 14:23
  • Create off (system property) `user.home` – g00se May 24 '23 at 14:26
  • You may find https://stackoverflow.com/questions/35388882/find-place-for-dedicated-application-folder useful. – VGR May 24 '23 at 19:21

1 Answers1

0

Try to point the folder to your user default folder like /home/userName/yourAppName .

you can get this path using echo $HOME at your unix terminal