Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document more scripts and introduce a config file.
- Loading branch information
1 parent
92816f7
commit 313705f
Showing
6 changed files
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
config.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
git-gc-repos: | ||
glob: | ||
- /u/apps/**/.git | ||
|
||
notify-if-queue-becomes-large: | ||
threshold: 1000 | ||
to: your@email.com | ||
from: your@server.com | ||
subject: Queue going out of control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
# This script is automatically called in a cron job by root. | ||
require File.expand_path(File.dirname(__FILE__) + '/shared') | ||
require 'etc' | ||
|
||
DIRS = Dir[ | ||
"/u/apps/**/.git" | ||
] | ||
DIRS = Dir[*config(:glob)] | ||
DIRS.each do |dir| | ||
puts "# Garbage collecting #{dir}" | ||
Dir.chdir(dir) do | ||
stat = File.stat(dir) | ||
username = Etc.getpwuid(stat.uid).name | ||
command = "su -c 'git gc' #{username}" | ||
puts command | ||
if !system(command) | ||
abort "'git gc' failed" | ||
end | ||
quiet_sh "su -c 'git gc' #{username}" | ||
end | ||
puts | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters