-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschedule.rb
40 lines (29 loc) · 1.43 KB
/
schedule.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
set :output, '/root/alegreme/logs/whenever/cron.log'
# Remove deleted events
#every 1.day, at: '11:00 pm' do
# command "cd /root/alegreme/scrapy && sudo docker-compose run --rm scrapy scrapy crawl deleted_event -s JOBDIR=crawls/deleted-event-1 && sudo docker-compose down"
#end
#every 1.day, at: '11:30 pm' do
# command "cd /root/alegreme && sudo docker exec alegreme_app_1 bundle exec rake remove:deleted_events similar:events suggestions:users"
#end
# Populate new events
every 1.day, at: ['12:00 pm', '18:00 pm'] do
command "cd /root/alegreme/scrapy && sudo docker-compose run --rm scrapy scrapy crawl event -s JOBDIR=crawls/event-1 && sudo docker-compose down"
end
every 1.day, at: ['13:30 pm', '19:30 pm'] do
command "cd /root/alegreme && sudo docker exec alegreme_app_1 bundle exec rake populate:events similar:events suggestions:users sitemap:refresh search:refresh"
end
# Populate new movies
every 1.day, at: ['11:00 am', '17:00 pm'] do
command "cd /root/alegreme/scrapy && sudo docker-compose run --rm scrapy scrapy crawl movie -s JOBDIR=crawls/movie-1 && sudo docker-compose down"
end
every 1.day, at: ['11:40 am', '17:40 pm'] do
command "cd /root/alegreme && sudo docker exec alegreme_app_1 bundle exec rake populate:movies"
end
# DevOps
every 1.day do
command "cd /root/alegreme && > logs/api/error.log"
end
every 1.month do
command "cd /root/alegreme && sudo ./init-letsencrypt.sh"
end