0

I'm a software developer and only in the last year or so have I been using Linux Mint over Windows as my working dev environment. For the last year I figured I'd do things my way and adapt as I learn the proper way to do things. So far so good. Relevant to this question, I've been putting my source code to my work and personal projects in a folder I created in my home directory: ~/src

In the last week I updated to Mint 19 and Timeshift is a front and center feature in it. I've set up my backups but noticed that my encrypted home directory is marked as an exclusion from my backups. I do use remote git repos to store my source but I would also feel a lot better if my Timeshift backups had my code as well. I could add an inclusive filter to Timeshift but I think it's time I look into where my source SHOULD be stored. A little research produced the very helpful Filesystem Hierarchy Standard (pdf) and it brought /usr/local/src to my attention but doesn't go into detail about it.

I know this question seems a little subjective but Linux has always seemed to be a developer friendly OS which makes me believe there's an idiomatic place to keep my personal source code separate from source I download/make/install.

Where does Linux intend I place my source? Or should I just add an inclusive filter to Timeshift to backup ~/src?

closed as primarily opinion-based by Thomas Dickey, Rui F Ribeiro, schily, Jeff Schaller, Romeo Ninov Jul 11 '18 at 4:04

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.

  • Is your backup, backing up the backing store for the encrypted file-system (that is the encrypted version). – ctrl-alt-delor Jul 10 '18 at 17:23
  • I am a fan of /opt for my source code... – jc__ Jul 10 '18 at 17:25
  • @ctrl-alt-delor Timeshift by default will not backup any home directories, encrypted or otherwise. The latest version when you tell it to backup your home directory will back up the .ecryptfs directory for your user. So I am now backing up the encrypted version of my home directory including my src. – Corey Ogburn Jul 10 '18 at 18:00
2

/usr/local/src is the local equivalent of /usr/src, which the FHS describes as

Source code may be place placed in this subdirectory, only for reference purposes.

Neither /usr/src or /usr/local/src are intended as working directories, especially not for a specific user. All your data is supposed to live under your home directory, and the FHS doesn’t have much to say about what you do there.

I think the appropriate solution in your case is to configure Timeshift so that it backs your source code up.

1

First it is normal for everything to go in your home folder ~/ = $HOME usually equal to /home/$USER. If you install 3rd party stuff, it goes in /usr/local or /opt (depending on structure of the stuff).

The main difference between the layout of a Unix users home directory, and a MS-Windows users, is:

Traditionally on Windows/dos, one would put all of the .doc files in one place, and all of the excel files in another, and all the PDFs somewhere else etc.

Where as on Unix you will put all of project-1's files in one directory, and all of project-2's files in another. You may create a sub-directory to put auto-created files (compiled files).

Not the answer you're looking for? Browse other questions tagged or ask your own question.