Skip to content

Commit

Permalink
Added Sample Cron Job to test Whenever Gem
Browse files Browse the repository at this point in the history
  • Loading branch information
namangupta01 committed May 15, 2018
1 parent 5f649b8 commit ea925bf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ ADD Gemfile /tmp/Gemfile
ADD Gemfile.lock /tmp/Gemfile.lock
RUN bundle install --jobs 4



ADD . /app
WORKDIR /app

RUN bundle exec whenever --update-crontab
RUN service cron start

RUN bower install --allow-root
8 changes: 8 additions & 0 deletions config/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@
# end

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

# Cron Job log file
set :output, "#{Dir.pwd}/public/cron_log.log"

# To simply print date into the log file for checking if cron job is working properly
every 1.minutes do
command "date -u" #This will print utc time every 1 min in log/cron_log.log file
end
Empty file added public/cron_log.log
Empty file.

0 comments on commit ea925bf

Please sign in to comment.