Skip to content

Commit

Permalink
Using whenever for editing cront tasks which backups database.
Browse files Browse the repository at this point in the history
  • Loading branch information
paneq committed Jun 21, 2009
1 parent 9f6e78a commit 0dcc830
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions config/environment.rb
Expand Up @@ -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'
Expand Down
35 changes: 35 additions & 0 deletions config/schedule_example.rb
@@ -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
3 changes: 2 additions & 1 deletion lib/tasks/config_copy.rake
Expand Up @@ -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.