-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjobby.php
65 lines (56 loc) · 1.54 KB
/
jobby.php
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
<?php
// prevent bug #95
$_SERVER['HTTP_HOST'] = $argv[1];
$_MAMA_SERVER_HTTP_HOST = $argv[1];
// API
require_once "vendor/autoload.php";
require_once "bootstrap.php";
//
// Add this line to your crontab file:
//
// * * * * * cd /path/to/project && php jobby.php $_MAMA_SERVER_HTTP_HOST >> /dev/null 2>&1
//
$jobby = new \Jobby\Jobby();
$jobby->add('DailyMail', array(
// cmd
// 'command' => 'php cron_jobs/dailyMailler.php"',
'command' => function () {
echo `php cron_jobs/dailyMailler.php $_MAMA_SERVER_HTTP_HOST`;
return true;
},
// each day
'schedule' => $cron_daily_mailler,
'output' => $cron_daily_mailler_log,
'enabled' => true
));
$jobby->add('WeeklyMail', array(
'command' => function () {
echo `php cron_jobs/weeklyMailler.php $_MAMA_SERVER_HTTP_HOST`;
return true;
},
// each monday at 8 am
'schedule' => $cron_weekly_mailler,
'output' => $cron_weekly_mailler_log,
'enabled' => true
));
$jobby->add('MonthlyUsersInativer', array(
'command' => function () {
echo `php cron_jobs/monthlyUsersInactiver.php $_MAMA_SERVER_HTTP_HOST`;
return true;
},
// each first monday of the month
'schedule' => $cron_monthly_users_inactiver,
'output' => $cron_monthly_users_inactiver_log,
'enabled' => true
));
$jobby->add('MonthlyUsersAnonymizer', array(
'command' => function () {
echo `php cron_jobs/monthlyUsersAnonymizer.php $_MAMA_SERVER_HTTP_HOST`;
return true;
},
// each first monday of the month
'schedule' => $cron_monthly_users_inactiver,
'output' => $cron_monthly_users_inactiver_log,
'enabled' => true
));
$jobby->run();