Capistrano.configuration(:must_exist).load do

  desc "Usuwa stare pliki sesji z katalogu /tmp"
  task :clean_sessions, :role => :app do 
    run "find /tmp/ruby_sess.* -ctime +2 -print | xargs rm -rf"
  end

  desc <<-DESC 
    Copy mongrel_cluster.yml to /etc/mongrel_cluster/,
    named after your application (e.g.cookbook.yml).
  DESC
  task :link_mongrel_config, :role => :app do 

    sudo "mkdir -p /etc/mongrel_cluster"

    sudo <<-CMD
      ln -nfs /var/www/cookbook/current/config/mongrel_cluster.yml \
        /etc/mongrel_cluster/#{application}.conf
    CMD
  end

end
