Permalink
Browse files

Using whenever for editing cront tasks which backups database.

  • Loading branch information...
paneq committed Jun 21, 2009
1 parent 9f6e78a commit 0dcc83099e8c02bdaba40b0e5bdfe162b3bc9a13
Showing with 41 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +3 −0 config/environment.rb
  3. +35 −0 config/schedule_example.rb
  4. +2 −1 lib/tasks/config_copy.rake
@@ -12,6 +12,7 @@ config/site_keys.yml
config/sphinx.yml
config/*.sphinx.conf
config/backup_fu.yml
config/schedule.rb
config/initializers/hoptoad.rb
db/sphinx/**/*.spa
db/sphinx/**/*.spd
@@ -97,6 +97,9 @@
#sending mails from google.
config.gem 'ambethia-smtp-tls', :lib => 'smtp-tls', :version => '~> 1.1.2'

#whenever for configuring cron tasks.
config.gem 'javan-whenever', :lib => false, :source => 'http://gems.github.com'

# Required only for project development
# config.gem 'flay'
# config.gem 'flog'
@@ -0,0 +1,35 @@
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron

# Example:
#
# set :cron_log, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyModel.some_method"
# rake "some:great:rake:task"
# end
#
# every 4.days do
# runner "AnotherModel.prune_old_records"
# end

# Learn more: http://github.com/javan/whenever


# We use backup_fu for backuping database.

#every 1.day, :at => '2:30 pm' do
# rake "backup_fu:all"
#end

#every 1.day, :at => '2:30 am' do
# rake "backup_fu:all"
#end

#every 2.hours do
# rake "sphinx:index"
#end
@@ -4,5 +4,6 @@ namespace :config do
#FIXME: Make parameter for source pwd with default option
puts `cp -v ../config/*.yml config/`
puts `cp -v ../config/deploy.rb config/`
puts `cp -v ../config/schedule.rb config/`
end
end
end

0 comments on commit 0dcc830

Please sign in to comment.