Take the 2-minute tour ×

There's a system-created /var/backups directory on Debian-based systems. I need a place to store backups of several git repositories (the primaries are on bitbucket). If I store them in /var/backup/git will that break apt-get, or will they get automatically deleted at inopportune times? Is there any reason I shouldn't use /var/backup? If there is, what is a reasonable alternative?

share|improve this question
It is not dangerous to do so. –  fpmurphy1 Mar 21 '13 at 16:31
add comment

2 Answers

up vote 7 down vote accepted

/var/backups is specific to Debian. It is not specified in the FHS, and its use is not documented in Debian policy (See Debian Bug report logs - #122038). The behavior is described in http://ubuntuforums.org/showthread.php?t=1232703.

While I agree with @fpmurphy that there is little danger of Debian ever removing your backup files in /var/backup, I think that it is not good policy to use a directory that is so Debian-specific. For one, Debian might change its policy and break things. For another, the user community already has specific expectations about what the directory is for. And finally, because it is not "portable" in the sense that it is not clear where this directory would be in a non-Debian distribution.

If my understanding of the FHS is correct, it would be appropriate to put clones of Git repositories in /opt/<project_name>/.git or in /usr/local/src/<project_name/.git. My personal inclination would be to use the former because it leaves the door open to backup project resources that are not source files and therefore not in Git.

If you really want to emphasis the backup nature of these repositories, you could put them in /backups, or even /home/backups, two directory names that are often used as mount points for external storage.

share|improve this answer
add comment

The best way to backup git repositories is to have a (bare) clone of the repository. git is quite frugal in its space usage, there will be almost no gain in compressing anything there. And a clone can easily be kept up to date (unless upstream does stupid pranks like wholesale history rewriting, nothing can be lost).

share|improve this answer
add comment

Your Answer


