Where should I store my application files (data, cache, logs, crashes, etc.) [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0














Although I did some research on this subject, I couldn't reach the exact information I wanted. Actually, not exactly disclosed, everyone approached in a different way.



For the: Filesystem Hierarchy Standard



I should store my files at:



  • Temp files: /var/temp/app_name/* or /temp/app_name/*


  • Cache files: /var/cache/app_name/*


  • Config files: ~/.config/app_name/*


  • Log files: /var/log/app_name/*


  • Data files (database, etc.): ???


Q1: Is that the right approach for the recent systems?



For the XDG standart that explained here:



  • Temp files: ??? or /temp/app_name/*


  • Cache files: ~/.cache/app_name/*


  • Config files: ~/.config/app_name/*


  • Log files: ???


  • Data files (database, etc.): ???


I cant understand why we store a cache file in the ~/.cache. It doesn't make any sense to me because there was a built-in cache folder called /var/cache



In that case, I'm confused. Everywhere I investigate, there have been different approaches.



Q2: Where should we put the files (datas, logs, temps, configs, etc.) for a pure Linux distribution (which does not use $XDG) to create applications?



Q3: Some applications use the Linux structure, but some of use the XDG structure. How do they choose this? According to what situation? Do they use $XDG environment variables if we're using them?



According to the above situation, my env | grep -i "XDG" output:



XDG_VTNR=1
XDG_SESSION_ID=1
XDG_DATA_DIRS=/home/furkan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0


P.S: I don't know the parts I'm showing with ???










share|improve this question













closed as primarily opinion-based by JigglyNaga, Kiwy, schily, jimmij, Mr Shunz Dec 13 at 14:40


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.



















    0














    Although I did some research on this subject, I couldn't reach the exact information I wanted. Actually, not exactly disclosed, everyone approached in a different way.



    For the: Filesystem Hierarchy Standard



    I should store my files at:



    • Temp files: /var/temp/app_name/* or /temp/app_name/*


    • Cache files: /var/cache/app_name/*


    • Config files: ~/.config/app_name/*


    • Log files: /var/log/app_name/*


    • Data files (database, etc.): ???


    Q1: Is that the right approach for the recent systems?



    For the XDG standart that explained here:



    • Temp files: ??? or /temp/app_name/*


    • Cache files: ~/.cache/app_name/*


    • Config files: ~/.config/app_name/*


    • Log files: ???


    • Data files (database, etc.): ???


    I cant understand why we store a cache file in the ~/.cache. It doesn't make any sense to me because there was a built-in cache folder called /var/cache



    In that case, I'm confused. Everywhere I investigate, there have been different approaches.



    Q2: Where should we put the files (datas, logs, temps, configs, etc.) for a pure Linux distribution (which does not use $XDG) to create applications?



    Q3: Some applications use the Linux structure, but some of use the XDG structure. How do they choose this? According to what situation? Do they use $XDG environment variables if we're using them?



    According to the above situation, my env | grep -i "XDG" output:



    XDG_VTNR=1
    XDG_SESSION_ID=1
    XDG_DATA_DIRS=/home/furkan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
    XDG_RUNTIME_DIR=/run/user/1000
    XDG_SEAT=seat0


    P.S: I don't know the parts I'm showing with ???










    share|improve this question













    closed as primarily opinion-based by JigglyNaga, Kiwy, schily, jimmij, Mr Shunz Dec 13 at 14:40


    Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

















      0












      0








      0







      Although I did some research on this subject, I couldn't reach the exact information I wanted. Actually, not exactly disclosed, everyone approached in a different way.



      For the: Filesystem Hierarchy Standard



      I should store my files at:



      • Temp files: /var/temp/app_name/* or /temp/app_name/*


      • Cache files: /var/cache/app_name/*


      • Config files: ~/.config/app_name/*


      • Log files: /var/log/app_name/*


      • Data files (database, etc.): ???


      Q1: Is that the right approach for the recent systems?



      For the XDG standart that explained here:



      • Temp files: ??? or /temp/app_name/*


      • Cache files: ~/.cache/app_name/*


      • Config files: ~/.config/app_name/*


      • Log files: ???


      • Data files (database, etc.): ???


      I cant understand why we store a cache file in the ~/.cache. It doesn't make any sense to me because there was a built-in cache folder called /var/cache



      In that case, I'm confused. Everywhere I investigate, there have been different approaches.



      Q2: Where should we put the files (datas, logs, temps, configs, etc.) for a pure Linux distribution (which does not use $XDG) to create applications?



      Q3: Some applications use the Linux structure, but some of use the XDG structure. How do they choose this? According to what situation? Do they use $XDG environment variables if we're using them?



      According to the above situation, my env | grep -i "XDG" output:



      XDG_VTNR=1
      XDG_SESSION_ID=1
      XDG_DATA_DIRS=/home/furkan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
      XDG_RUNTIME_DIR=/run/user/1000
      XDG_SEAT=seat0


      P.S: I don't know the parts I'm showing with ???










      share|improve this question













      Although I did some research on this subject, I couldn't reach the exact information I wanted. Actually, not exactly disclosed, everyone approached in a different way.



      For the: Filesystem Hierarchy Standard



      I should store my files at:



      • Temp files: /var/temp/app_name/* or /temp/app_name/*


      • Cache files: /var/cache/app_name/*


      • Config files: ~/.config/app_name/*


      • Log files: /var/log/app_name/*


      • Data files (database, etc.): ???


      Q1: Is that the right approach for the recent systems?



      For the XDG standart that explained here:



      • Temp files: ??? or /temp/app_name/*


      • Cache files: ~/.cache/app_name/*


      • Config files: ~/.config/app_name/*


      • Log files: ???


      • Data files (database, etc.): ???


      I cant understand why we store a cache file in the ~/.cache. It doesn't make any sense to me because there was a built-in cache folder called /var/cache



      In that case, I'm confused. Everywhere I investigate, there have been different approaches.



      Q2: Where should we put the files (datas, logs, temps, configs, etc.) for a pure Linux distribution (which does not use $XDG) to create applications?



      Q3: Some applications use the Linux structure, but some of use the XDG structure. How do they choose this? According to what situation? Do they use $XDG environment variables if we're using them?



      According to the above situation, my env | grep -i "XDG" output:



      XDG_VTNR=1
      XDG_SESSION_ID=1
      XDG_DATA_DIRS=/home/furkan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
      XDG_RUNTIME_DIR=/run/user/1000
      XDG_SEAT=seat0


      P.S: I don't know the parts I'm showing with ???







      linux directory directory-structure xdg xdg-user-dirs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 13 at 11:32









      Furkan Türkal

      32




      32




      closed as primarily opinion-based by JigglyNaga, Kiwy, schily, jimmij, Mr Shunz Dec 13 at 14:40


      Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.






      closed as primarily opinion-based by JigglyNaga, Kiwy, schily, jimmij, Mr Shunz Dec 13 at 14:40


      Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Part of your confusion may be the distinction between user applications and system applications.



          So, for example, apache isn't run as an end user ("Harry" normally doesn't run Apache; it's run from a system startup script - systemd or init or however). These sort of applications typically will follow the file system standard and store log files in /var/log, configuration files in /etc and so on.



          Similarly, commands executed by the systems administrator as root designed to impact the whole machine (e.g. apt or yum) also follow the file system standard.



          However, applications designed to be executed by the end user (e.g. a web browser and other desktop applications) follow the XDG standard. Here "Harry" has his own personal cache, which is different to "Julie"; they visit different web sites, so have cached different pages. Similarly, Harry may configure his desktop different to Julie, and so the configuration will be in the ~/.config area.



          Some locations (eg /tmp) are designed to be shared by all users, so even desktop apps can use them... but even here a more modern /run/user/ structure is sometimes used.






          share|improve this answer




















          • So, in that case, i should follow the XDG standart. :) Because the end user will use the software. Thank you!
            – Furkan Türkal
            Dec 13 at 19:39


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Part of your confusion may be the distinction between user applications and system applications.



          So, for example, apache isn't run as an end user ("Harry" normally doesn't run Apache; it's run from a system startup script - systemd or init or however). These sort of applications typically will follow the file system standard and store log files in /var/log, configuration files in /etc and so on.



          Similarly, commands executed by the systems administrator as root designed to impact the whole machine (e.g. apt or yum) also follow the file system standard.



          However, applications designed to be executed by the end user (e.g. a web browser and other desktop applications) follow the XDG standard. Here "Harry" has his own personal cache, which is different to "Julie"; they visit different web sites, so have cached different pages. Similarly, Harry may configure his desktop different to Julie, and so the configuration will be in the ~/.config area.



          Some locations (eg /tmp) are designed to be shared by all users, so even desktop apps can use them... but even here a more modern /run/user/ structure is sometimes used.






          share|improve this answer




















          • So, in that case, i should follow the XDG standart. :) Because the end user will use the software. Thank you!
            – Furkan Türkal
            Dec 13 at 19:39
















          2














          Part of your confusion may be the distinction between user applications and system applications.



          So, for example, apache isn't run as an end user ("Harry" normally doesn't run Apache; it's run from a system startup script - systemd or init or however). These sort of applications typically will follow the file system standard and store log files in /var/log, configuration files in /etc and so on.



          Similarly, commands executed by the systems administrator as root designed to impact the whole machine (e.g. apt or yum) also follow the file system standard.



          However, applications designed to be executed by the end user (e.g. a web browser and other desktop applications) follow the XDG standard. Here "Harry" has his own personal cache, which is different to "Julie"; they visit different web sites, so have cached different pages. Similarly, Harry may configure his desktop different to Julie, and so the configuration will be in the ~/.config area.



          Some locations (eg /tmp) are designed to be shared by all users, so even desktop apps can use them... but even here a more modern /run/user/ structure is sometimes used.






          share|improve this answer




















          • So, in that case, i should follow the XDG standart. :) Because the end user will use the software. Thank you!
            – Furkan Türkal
            Dec 13 at 19:39














          2












          2








          2






          Part of your confusion may be the distinction between user applications and system applications.



          So, for example, apache isn't run as an end user ("Harry" normally doesn't run Apache; it's run from a system startup script - systemd or init or however). These sort of applications typically will follow the file system standard and store log files in /var/log, configuration files in /etc and so on.



          Similarly, commands executed by the systems administrator as root designed to impact the whole machine (e.g. apt or yum) also follow the file system standard.



          However, applications designed to be executed by the end user (e.g. a web browser and other desktop applications) follow the XDG standard. Here "Harry" has his own personal cache, which is different to "Julie"; they visit different web sites, so have cached different pages. Similarly, Harry may configure his desktop different to Julie, and so the configuration will be in the ~/.config area.



          Some locations (eg /tmp) are designed to be shared by all users, so even desktop apps can use them... but even here a more modern /run/user/ structure is sometimes used.






          share|improve this answer












          Part of your confusion may be the distinction between user applications and system applications.



          So, for example, apache isn't run as an end user ("Harry" normally doesn't run Apache; it's run from a system startup script - systemd or init or however). These sort of applications typically will follow the file system standard and store log files in /var/log, configuration files in /etc and so on.



          Similarly, commands executed by the systems administrator as root designed to impact the whole machine (e.g. apt or yum) also follow the file system standard.



          However, applications designed to be executed by the end user (e.g. a web browser and other desktop applications) follow the XDG standard. Here "Harry" has his own personal cache, which is different to "Julie"; they visit different web sites, so have cached different pages. Similarly, Harry may configure his desktop different to Julie, and so the configuration will be in the ~/.config area.



          Some locations (eg /tmp) are designed to be shared by all users, so even desktop apps can use them... but even here a more modern /run/user/ structure is sometimes used.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 13 at 12:42









          Stephen Harris

          24.5k24477




          24.5k24477











          • So, in that case, i should follow the XDG standart. :) Because the end user will use the software. Thank you!
            – Furkan Türkal
            Dec 13 at 19:39

















          • So, in that case, i should follow the XDG standart. :) Because the end user will use the software. Thank you!
            – Furkan Türkal
            Dec 13 at 19:39
















          So, in that case, i should follow the XDG standart. :) Because the end user will use the software. Thank you!
          – Furkan Türkal
          Dec 13 at 19:39





          So, in that case, i should follow the XDG standart. :) Because the end user will use the software. Thank you!
          – Furkan Türkal
          Dec 13 at 19:39



          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?