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.

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
  • Thanks. Will using symlinks as configuration files create some unseen problems down the road? – Tim Apr 3 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 3 at 14:34

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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