You are not logged in.

#1 2012-04-25 04:45:05

benash
Member
From: Detroit, MI
Registered: 2011-07-14
Posts: 14

Method of tracking system modifications?

Hi everyone,

I've been learning a lot after installing Arch and then going through the great wiki documentation.  However, it doesn't feel right when I make a change to a configuration file or install a needed package and then forget about it.  I'd like to have some way to track these sort of changes.

For example, I've spent some time figuring out the settings for my Synaptics touchpad that I like.  In case I reinstall my system or get another machine, I'd like some way of saving these settings so I don't have to figure them out again.

How do people deal with this problem?  Is there a utility that might help?  Do people save a list of installed packages and configuration files into a Git repository?

Thanks,
Ben

Offline

#2 2012-04-25 05:15:41

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Method of tracking system modifications?

Personally, my config files that matter in $HOME (all sorts of dotfiles) get synced to my github. For systemwide config files that are worth backing up, I simply rsync those to a NAS on my network.


Burninate!

Offline

#3 2012-04-25 05:29:07

benash
Member
From: Detroit, MI
Registered: 2011-07-14
Posts: 14

Re: Method of tracking system modifications?

Thanks, Gcool, I see your dotfiles on Github.  Did you create a git repo from your home directory and then add the files that you wanted to track?  If I did that, I was wondering if I could also add hardlinks to files like xorg.conf.d/* as a way of keeping those files tracked.  Would that work?

Offline

#4 2012-04-25 05:36:41

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: Method of tracking system modifications?

I simply created a directory /home/gcool/git/<reponame> and simply copy the files I want to keep/track in there each time I've edited them. For systemwide config files you can do the same thing obviously.

As for linking to those files; you could try using symlinks to those files (ex: /home/benash/git/xorg_backup which then symlinks to /etc/X11/xorg.conf). I've never tried this myself, so not 100% sure if this works when git syncing.


Burninate!

Offline

#5 2012-04-25 08:14:25

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Method of tracking system modifications?

Seems like all you need is a proper backup system rather than a way of 'tracking' modifications.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#6 2012-04-25 08:59:03

benash
Member
From: Detroit, MI
Registered: 2011-07-14
Posts: 14

Re: Method of tracking system modifications?

Hi ngoonee.  In my instance, I'm getting a new system for work.  I'd like to be able to apply the modifications from my home machine to my work machine.  That's why I was thinking some sort of source control approach would work.  I also found this, which was of interest to me:

https://github.com/rtomayko/dotfiles

Offline

#7 2012-04-26 01:25:09

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Method of tracking system modifications?

smile I'd just use a diff app on /etc myself, but to each his own.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2012-05-04 17:06:17

archwade
Member
Registered: 2010-01-26
Posts: 14

Re: Method of tracking system modifications?

I use a similar method to Gcool where I have config files stored in separate directory, but instead of copying them back and forth, I use symlinks:

.bashrc -> git/config/bashrc

I also remove the dot prefix in my repo to make life easier.

Offline

#9 2012-05-05 16:19:09

benash
Member
From: Detroit, MI
Registered: 2011-07-14
Posts: 14

Re: Method of tracking system modifications?

I like that, archwade.  I think I'd also want to have some sort of script that created all the symlinks.

Offline

#10 2012-05-18 09:35:03

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: Method of tracking system modifications?

I use duplicity to back up my /home and /etc directories to my NAS.

I wrote a simple script and link it to an icon on my panel. The script takes 4 arguments, the gpg key and passphrase for duplicity, the path to store the backup and a boolean flag to verify the backup (duplicity verifies are always on the entire backup, not just the increment, so it can take a while). It uses notify-send to update you on progress and libcanberra for notification sounds (superlative I know but I can start a backup, go and do something else, and still be aware of the progress).

It also stores installed package logs and a package diff so I can track install changes easily.

Modify to your hearts content.

Cheers.

#! /bin/bash

# get encryption key and backup path

_key=$1
_pass=$2
_path=$3
_verify=$4


# ensure backup path is absolute

case $_path in
  /*)
    _root=$_path
    ;;
  *)
    _root=/$_path
    ;;
esac


# ensure backup path has trailing /

case $_root in
  */)
    _root_path=$_root
    ;;
  *)
    _root_path=$_root/
    ;;
esac


# ensure backup path exists

if ! [ -d $_root_path ]; then
  notify-send -u critical -i emblem-synchronizing "System Backup" "<b>Backup path does not exist</b>\n<i>${_root_path}</i>"
  canberra-gtk-play -i dialog-error
  exit 0
fi


# set log paths

_log_path=${_root_path}logs/
_pkg_path=${_log_path}packages/
_dup_path=${_log_path}backups/


# set backup path

_bck_path=${_root_path}backups/
_hme_path=${_bck_path}home/
_etc_path=${_bck_path}etc/


# set cache path

_cch_path=${_root_path}cache/


# ensure log paths exist

if ! [ -d $_log_path ]; then
  mkdir $_log_path
fi
if ! [ -d $_pkg_path ]; then
  mkdir $_pkg_path
fi
if ! [ -d $_dup_path ]; then
  mkdir $_dup_path
fi


# ensure backup path exists

if ! [ -d $_bck_path ]; then
  mkdir $_bck_path
fi
if ! [ -d $_hme_path ]; then
  mkdir $_hme_path
fi
if ! [ -d $_etc_path ]; then
  mkdir $_etc_path
fi


# ensure cache path exists

if ! [ -d $_cch_path ]; then
  mkdir $_cch_path
fi


# start backup

notify-send -u critical -i emblem-synchronizing "System Backup" "<b>Backup process started in</b>\n<i>${_root_path}</i>"
canberra-gtk-play -i dialog-warning


# get current time
_date=`date`
_time=`date +%Y%m%d%H%M%S`


# update package logs

notify-send -i emblem-synchronizing "System Backup" "<b>Logging installed package changes in</b>\n<i>${_root_path}</i>"
canberra-gtk-play -i message

if ! [ -f ${_pkg_path}original.list ]; then
  echo $_date > ${_pkg_path}original.list
  yaourt -Qs >> ${_pkg_path}original.list
  cp ${_pkg_path}original.list ${_pkg_path}current.list
else
  echo $_date > ${_pkg_path}temp.list
  yaourt -Qs >> ${_pkg_path}temp.list
  diff -sa ${_pkg_path}current.list ${_pkg_path}temp.list > ${_pkg_path}${_time}.diff
  rm ${_pkg_path}current.list
  mv ${_pkg_path}temp.list ${_pkg_path}current.list
fi


# backup /home

notify-send -i emblem-synchronizing "System Backup" "<b>Backing up home directory in</b>\n<i>${_root_path}</i>"
canberra-gtk-play -i message

duplicity --asynchronous-upload --encrypt-key ${_key} --log-file ${_dup_path}${_time}-home.log -v4 --archive-dir ${_cch_path} --name home /home file://${_hme_path}


# verify /home

if [ $_verify = "true" ]; then

  notify-send -i emblem-synchronizing "System Backup" "<b>Verifying home directory in</b>\n<i>${_root_path}</i>"
  canberra-gtk-play -i message

  export PASSPHRASE=${_pass}

  duplicity verify --encrypt-key ${_key} --log-file ${_dup_path}${_time}-home.log -v4 --archive-dir ${_cch_path} --name home file://${_hme_path} /home

  unset PASSPHRASE
  
fi


# backup /etc

notify-send -i emblem-synchronizing "System Backup" "<b>Backing up etc directory in</b>\n<i>${_root_path}</i>"
canberra-gtk-play -i message

duplicity --asynchronous-upload --encrypt-key ${_key} --log-file ${_dup_path}${_time}-etc.log -v4 --archive-dir ${_cch_path} --name etc /etc file://${_etc_path}


# verify /etc

if [ $_verify = "true" ]; then

  notify-send -i emblem-synchronizing "System Backup" "<b>Verifying etc directory in</b>\n<i>${_root_path}</i>"
  canberra-gtk-play -i message

  export PASSPHRASE=${_pass}

  duplicity verify --encrypt-key ${_key} --log-file ${_dup_path}${_time}-etc.log -v4 --archive-dir ${_cch_path} --name etc file://${_etc_path} /etc

  unset PASSPHRASE

fi


# finish backup

notify-send -u critical -i emblem-synchronizing "System Backup" "<b> Backup process finished. Location</b>\n<i>${_root_path}</i>"
canberra-gtk-play -i dialog-warning

exit 0

Offline

#11 2012-05-18 15:57:42

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Method of tracking system modifications?

I keep a mercurial repository in /etc.  I push commits after making changes, can see what it looked like over history, has excellent tools for merging in PACNEW files.  If I choose (I don't) I could shove this out to the cloud (I use bitbucket myself)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB