configuration = Capistrano::Configuration.respond_to?(:instance) ? Capistrano::Configuration.instance(:must_exist) : Capistrano.configuration(:must_exist) configuration.load do after "deploy:setup", :chown_entire_project_dir after "deploy:symlink", :symlink_init_d_script after "deploy:symlink", :symlink_log_dirs after "deploy:symlink", :symlink_pid_dirs after "deploy:symlink", :symlink_site_cache_dir # only keep the last 5 releases (otherwise diskspace balloons) after "deploy:update", "deploy:cleanup" end