public
Description: Some Ruby Tools to work on Amazon S3 and EC2, such as buckets list, creation, mysql backup to S3, cron jobs, and Gentoo specific little hacks... ;)
Homepage:
Clone URL: git://github.com/fred/amazon_ruby_tools.git
amazon_ruby_tools / instance_after_boot.rb
100644 26 lines (20 sloc) 0.478 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'fileutils'
 
@dirs = ["/mnt/gentoo/distfiles",
  "/mnt/gentoo/log",
  "/mnt/gentoo/portage",
  "/mnt/gentoo/tmp",
  "/mnt/apps",
  "/mnt/log",
  "/var/www"
]
 
 
@dirs.each do |dir|
  begin
    FileUtils.mkdir_p dir
    puts "Good, directory '#{dir}' created."
  rescue
    puts "There was an error."
    puts "Directory '#{dir}' not created."
  end
end
 
 
 
FileUtils.ln_s("/mnt/apps", "/var/www/apps", :force => true)
FileUtils.ln_s("/mnt/log", "/var/log", :force => true)