-
Notifications
You must be signed in to change notification settings - Fork 9
/
CronJobs
69 lines (54 loc) · 1.69 KB
/
CronJobs
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env ruby
#
# to preview cronfile : `whenever -f CronJobs`
# to generate cronfile : `whenever -f CronJobs --update-crontab`
# to clear cronfile : `whenever -f CronJobs --clear-crontab`
# for help on whenever : `whenever -h`
# to see cron settings : `crontab -l`
#
# Learn more:
# - http://github.com/javan/whenever | cron processor
# - http://en.wikipedia.org/wiki/Cron | cron instructions
# TODO: ADD LOGROTATE
CRON_UTIL = File.expand_path("~/util/code_util/bin/SysRole")
if File.exist?(CRON_UTIL)
load CRON_UTIL
else
abort "NO CRON_UTIL AT '#{CRON_UTIL}'"
end
whenever_config
every 1.minute do
run_scripts 'cron/heartbeat', app: "BUGMARK"
end
if dev_host?
# every 1.hour do
# run_scripts 'cron/download_backup', app: "BUGMARK"
# end
# every 7.days do
# run_scripts 'cron/backup_keys', app: "BUGMARK"
# end
end
if rails_production?
every 1.minute do
run_scripts 'cron/random_offer', app: 'BUGMARK', rails_env: "production"
end
every 5.minutes do
run_scripts 'cron/contract_cross', app: 'BUGMARK', rails_env: "production"
run_scripts 'metrics/base' , app: 'BUGMARK', rails_env: "production"
end
every 10.minutes do
run_scripts 'cron/contract_resolve', app: 'BUGMARK', rails_env: "production"
end
every 1.hour do
run_scripts 'cron/github_sync', app: 'BUGMARK', rails_env: "production"
end
every 1.week do
run_scripts 'cron/account_topup', app: 'BUGMARK', rails_env: "production"
end
# every 1.day, at: "00:30 am" do
# run_scripts 'cron/backup_db', app: "BUGMARK", rails_env: "production"
# end
# every 4.days, at: "01:30 am"do
# run_scripts 'cron/backup_sysdir', app: "BUGMARK", rails_env: "production"
# end
end