-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrontab
45 lines (34 loc) · 2.13 KB
/
crontab
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
41
42
43
44
45
# All imports are started at even hours
# Every two hours we load data for the most recent tournaments
35 */2 * * * bundle exec rake tournaments:results_for_recent[28]
40 */2 * * * bundle exec rake tournaments:rosters_for_recent[28]
# Many tournaments open their results at 20:59 UTC
0 21 * * * bundle exec rake tournaments:results_for_recent[3]
# Once a day we refresh data for all rating tournaments (starting with September 2021)
5 8 * * * bundle exec rake tournaments:results_for_rating
10 8 * * * bundle exec rake tournaments:rosters_for_rating
# Once a week we update data for all tournaments in the past year
15 2 * * TUE bundle exec rake tournaments:rosters_for_recent[365]
15 4 * * TUE bundle exec rake tournaments:results_for_recent[365]
# Updating base rosters for teams that have played rating tournaments
10 12 * * * bundle exec rake base_rosters:fetch_for_teams_in_rating_tournaments
# Refreshing all base rosters
0 2 * * TUE bundle exec rake base_rosters:fetch_id_range[1,30000]
0 2 * * WED bundle exec rake base_rosters:fetch_id_range[30001,30000]
0 2 * * THU bundle exec rake base_rosters:fetch_id_range[60001,30000]
0 2 * * FRI bundle exec rake base_rosters:fetch_id_range[90001,30000]
# Additional data: names of players and teams, new towns in the database
30 10 * * * bundle exec rake players:fetch_all
30 16 * * * bundle exec rake teams:fetch_all
0 12 * * * bundle exec rake towns:fetch_all
# Information about tournaments: name, city, number of questions
50 */6 * * * bundle exec rake tournaments:details_for_rating_tournaments
15 4 * * WED bundle exec rake tournaments:details_for_all_tournaments
# Seasons: changes should happen only once a year, but we recheck every week
15 6 * * THU bundle exec rake seasons:fetch_all
# Backups: we upload a backup of the two main schemas (public and b) to Cloudflare R2 every day
25 23 * * * bundle exec rake backup
# Vacuuming the database: during import runs, we delete a lot of rows, so the database needs regular vacuuming
0 23 * * * bundle exec rake vacuum
# Wrong team IDs: team IDs are assigned by representatives manually and sometimes need correction
0 20 * * * bundle exec rake export:continuity