#!/usr/bin/env ruby
# Copyright (C) 2003-2005 Kouichirou Eto, All rights reserved.

base = File.dirname(__FILE__)+"/.."
$LOAD_PATH.unshift(File.expand_path(base+"/lib"))
$LOAD_PATH.unshift(File.expand_path(base+"/compat"))
$base = base

def main
  Dir.chdir($base) 
 #date = Time.now.strftime("%Y-%m-%d")
  date = Time.now.strftime("%Y-%m-%dT%H")
  if ! FileTest.exist?("backup")
    Dir.mkdir("backup")
  end
  cmd = "tar cfj backup/data-#{date}.tar.bz2 data"
  puts cmd
  system cmd
end
main
