Relocating configuration and cache files

These instructions explain how to move configuration files from your home directory stored on the networked file server, to locations on your local desktop computer. It may be helpful to print out these instructions as they won't be available from a terminal session. It is important that you are not logged into a GUI session while the directories are copied.

  1. Before you start, download the commands you will need to create and copy the directories,  and the code that will be added to your .profile file:

    cd
    wget install.stats.ox.ac.uk/mirrors/Fedora/local/24/DIRECTORY_CODE
    wget install.stats.ox.ac.uk/mirrors/Fedora/local/24/RELOCATE_CODE

  2. Log out of the Graphical User Interface [GUI].  You must do this, because files accessed by the GUI should be moved while not in use.

  3. Log into a simple terminal session using your usual username and password. Use

    CTRL+ALT+F2

    to move to a terminal session login screen.  CTRL+ALT+F3 to CTRL+ALT+F6 are also available.

  4. Create the target directories. The easiest way is to copy and paste the contents of the previously downloaded file DIRECTORY_CODE. We recommend you copy and paste one line at a time.

    mkdir -p /data/`/bin/hostname -s`/$USER/.config
    mkdir -p /data/`/bin/hostname -s`/$USER/.local/share

    These commands will only work if you have a directory on your local desktop computer.

    For example if your computer is called parrot and your username is flint, then the commands

    mkdir -p /data/parrot/flint/.config
    mkdir -p /data/parrot/flint/.local/share

    will create the directories

    /data/parrot/flint/.config
    /data/parrot/flint/.local/share


  5. Copy over the contents of your ~/.config and ~/.local/share directories. Again, it is easiest to copy and paste the contents of the previously downloaded file, DIRECTORY_CODE. We recommend that you copy and paste one line at a time.

    cd
    cp -r .config/  /data/`/bin/hostname -s`/$USER/.config/.
    cp -r .local/share/ /data/`/bin/hostname -s`/$USER/.local/share/.


    This may well take a while.

  6. Edit ~/.profile to add the lines which enforce the change.  Again, it is easiest to insert the code found in the previously downloaded file, RELOCATE_CODE.  First take a backup of .profile:

    cd
    cp .profile .profile.bak


    Now use the nano editor to add the contents of the previously downloaded RELOCATE_CODE file.

    nano .profile

    then use the cursor keys to get to the correct location. The code should be inserted between

    if [ "$setenv" = "" ] ; then
        ##
        ## ADD YOUR OWN SHELL COMMANDS HERE.
        ##
        ## The stuff below auto starts X windows if you are on the console
        ## of a Sun. If you don't want to do this then replace everything
        ## from the "if" to the matching "fi" with a single line reading
        ## "exec $SHELL"
        ##


    and before

        if [ "${term}" = "network" ] ;  then
            TERM=sun-cmd         exec $SHELL
       fi
    fi


    Use the following commands to insert the contents of RELOCATE_CODE file once you are in the right place in the file:

    CTRL+R RELOCATE_CODE
    CTRL+X

    and confirm that you want to save the code.

    Now log out of the terminal session and return to the GUI with CTRL+ALT+F1.

  7. Log into the GUI to test the changes. To check that the changes have worked look at the access times of files in the the two new directories:

    cd /data/`/bin/hostname -s`/$USER/
    find . -cmin -5 -ls


    which should show recent activity in the .config and .local/share directories on the local desktop computer. A similar command run on your home directory should show no activity in these two directories. [The -cmin -5 option shows files that have changed in the last five minutes.]

  8. The .cache directory is now stored in /tmp.