User Tools

Site Tools


linux:sfinx-xdg

Sfinx-xdg ; configuration utility for XDG basedir standards

A lot of programs are using the Freedesktop XDG basedir setup, which puts configuration files in .config, cache in .cache and various data files of the application in .local
However, the data and cache parts can become quite big, causing two problems: quota usage on the home disk, and performance loss (since the home disk is remote, and this can cause lots of read and write access). Now the XDG standard provides a mechanism to move those files to another location, and we suggest users move them to one of their local data disks.

Default setup is to have the cache local, in /data1/$USERNAME/xdg/cache. This can be changed in configuration file ~/.sfinx-xdgrc. There you can also set flags to indicate if application data should be relocated as well, or disable the relocation of the cache (but really, there is no good reason to do that).

Moving to another computer

A problem arising from this setup is, that if a user moves to another computer, the cache doesn't automatically move with him/her. If cache points to the local disk, a new cache directory will be created on the first login, and all will be fine, except that previously cached data will not be available, and will in fact be left behind on the previous computer (so some cleanup might be necessary).

However, if you modify the configuration to use the network-accessible name for the directory (e.g. /net/computername/data1/$USERNAME/xdg), then it is up to you to move the directory and change the configuration to have things local again on your current computer, or you will loose all of the speed benefits of having cache.

If your setup just stores cache on the local disk, simply editing ~/.sfinx-xdgrc and logging in in a fresh session will take care of everything except cleaning up the old cache.
If you also store application data on the local disk (so if ~/.sfinx-xdgrc contains SFINX_XDG_DATA=1), you will need to move that data to the new location WHILE IT IS NOT IN USE. Best to log out any desktop or vnc sessions, and just log in on the Linux console or over ssh, then look up the old and new locations, and move the whole directory:

  1. edit ~/.sfinx-xdgrc, note the old XDG directory and change it to the desired new location
  2. make sure the new location exists: mkdir /net/newcomputer/data1/$USERNAME/xdg
  3. move old location to new, eg mv /net/oldcomputer/data1/$USERNAME/xdg /net/newcomputer/data1/$USERNAME/xdg
  4. log out
linux/sfinx-xdg.txt · Last modified: 2019/09/24 09:32 by jansen