1

I was wondering if it is a good practice to make the following configuration files as symlinks to some scripts under a directory e.g. ~/program_files/configurations/.

  • The scripts /etc/rc.local, /etc/profile, ~/.profile, ~/.bash_profile, ~/.bashrc are executed upon OS starting up, login shell starting up, and interactive non-login shell starting up respectively.

  • Scripts under /usr/lib/pm-utils/sleep.d/ and /etc/pm/sleep.d/ are executed upon OS suspension/hibernation and resuming/thawing.

My intention is that it will be easier to back up files in a directory than files in multiple directories.

Will using symlinks as configuration files create some unseen problems down the road?

Is it also a good idea to write a script to link the configuration files under ~/program_files/configuration/ to where they will be used respectively?

Thanks.

Tim
  • 98,580
  • 191
  • 570
  • 977

1 Answers1

2

This is quite common actually especially with dotfiles. The idea is that you keep all your config files (hence dotfiles - conventionally they start with .) in a single git repository. It allows for easy synchronization between various machines and backup is provided for free thanks to how git works. For example, on my machine:

$ ls -Alhtr ~/.bashrc
lrwxrwxrwx 1 ja users 21 Jun 22  2016 /home/ja/.bashrc -> dotfiles/bash/.bashrc
Arkadiusz Drabczyk
  • 25,049
  • 5
  • 53
  • 68
  • Thanks. Will using symlinks as configuration files create some unseen problems down the road? – Tim Apr 03 '18 at 14:29
  • I haven't had any problems with that. `Emacs` for example asks: `Symbolic link to Git-controlled source file; follow link? (y or n)` every time I open my `~/.bashrc`. – Arkadiusz Drabczyk Apr 03 '18 at 14:34