Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have no idea how to use any backup software with Linux, but I do know Git. I hope this isn't a silly question as the obvious answer is to use some form of backup software, perhaps - but, I was curious about this scenario - and if it is viable.

Can Git be used when experimenting, changing drivers and software on Linux - specifically Ubuntu 11.10.

I am wondering, say for example - I wanted to change the drivers for something, if making a commit point to rollback to using Git would be a simple way of backing up prior to making a potentially harmful change to the system?

share|improve this question
1  
For those unfamiliar with the scenario of changing drivers it might be help if you describe that scenario in detail so that it is easier to decide whether git would be helpful. –  N.N. Apr 6 '12 at 12:22
    
For example, removing pulseaudio by sudo apt-get autoremove pulseaudio I believe. Then trying to install ALSA instead by sudo apt-get install alsa-base, and seeing if things are still working okay. If not, trying to re-install pulseaudio but it then all get's mucked up -so opting to rollback instead. –  defaye Apr 6 '12 at 12:26
    
In this scenario then, my main thoughts would be- if using something like Git, then where would be the place to initialise it? Does this help or would you like me to explain more? –  defaye Apr 6 '12 at 12:28
    
That sounds like having git track package management as well. You may benefit from presenting those details in your question instead by editing it. –  N.N. Apr 6 '12 at 12:36
    
I'm sorry about that –  defaye Apr 6 '12 at 12:44

2 Answers 2

up vote 3 down vote accepted

It could/would work, but you'd have to be careful to really take everything into account. Possibly changed init scripts, configuration files, the state of the package manager, etc. It would very soon become complex if you have made several changes and want to revert back to change -5 say. It's not just to remove the files and hope for the best; all configuration and state files would also have to be reverted, and maybe they are in a binary format and so on.

In practice, there should not be any "cruft" left behind on Linux if you "know what you are doing" (tm). Files are contained in a much better way than on e.g. Windows, and are normally ordered into packages which are tracked by the package manager. If I on a Debian based system do

aptitude install gimp

, try Gimp out, and then do

aptitude purge gimp

to remove it, there should not be anything left behind in the process, except perhaps personal configuration files.


The concept of "drivers" is not the same is in Windows either; it is often a question of modules contained in the kernel or loaded separately. The later behave much more like regular programs.


All in all: no, I would not recommend using Git. I'd recommend simply using the package manager, or if you compile things yourself: either use the makefile's own mechanism for keeping track of what went where for later uninstallation, or use checkinstall to keep track of the changes via a package yourself.

When you install personal things, outside of the package managers knowledge, you should often be able to contain it in e.g. /usr/local/bin and /usr/local/lib instead if directly in /usr/bin and /usr/lib, thus not spreading random files all over the place.

share|improve this answer

Git isn't really suited to this, mainly because it doesn't handle large files well. You could have a look at git plugins for managing large files, and things like etckeeper (which tracks the config files in /etc using git or another (D)VCS). However, I think it's a poor choice for backups.

For now, I'd say look into faubackup. It's a very simple, reliable system that:

  • backs up files to a directory, whether that directory is local or remote
  • makes snapshots in that directory based on date
  • only backs up what's changed between snapshots
  • Removes older backups after keeping them for a period of time you specify.

You could also look at filesystems which provide snapshots, like btrfs and zfs. Backing up databases which are constantly being written, for example, without using snapshots (or locking database dumps) is bad news. But dumping the db to a file and making a backup of that is easiest, if you can find the storage space to do that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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