Mautic là opensource tự động hóa tiếp thị gồm email marketing, mạng xã hội (social marketing) và nhiều tính năng khác hỗ trợ cho marketing.Tham khảo thêm thông tin tại bài viết này >>
Về cài đặt và cấu hình phần mềm này thì khi có thời gian mình sẽ viết bài hướng dẫn cụ thể. Tuy nhiên bạn có thể tham khảo tại đây >> hoặc bạn cài thông qua các đóng gói tại bitnami ở đây >> , bitnami có cả gói cho Windows và Linux.
Tạo Cronjob cho Mautic
Việc tạo Cronjob Mautic trên Linux & Mac os trong cả 2 trường hợp cài đặt trên và tạo scheduled tasks của Mautic trên Windows khi bạn dùng gói cài đặt của bitnami thì tại phần Document đều có hướng dẫn cụ thể nhé.
Bài này mình hướng dẫn các bạn tạo scheduled tasks của Mautic trên Windows khi bạn dùng xampp & lampp hoặc dùng cho bộ cài đặt aphache - PHP - Mysql riêng, ở đây mình dùng xampp nhé (với lampp và bộ cài apache riêng thì bạn cũng làm tương tự). Vì thấy rất nhiều bạn vướng mắc vấn đề này.
Đầu tiền bạn phải cài đặt thành công Mautic trước đã nhé (chú ý tới requirements >> để bạn chọn apache-PHP-Mysql cho phù hợp nhé ), với xampp thì bạn nên cấu hình một tên miền vào file xampp\apache\conf\extra\httpd-vhosts.conf để quá trình cài đặt không bị bug (trường hợp không có tên miền thật thì bạn có thể cấu hình file hosts trên máy của bạn và dùng tên miền giả nhé ).
Sau khi đã cài đặt và cấu hình mọi thứ ok thì giờ tới lúc tạo scheduled tasks cho nó.
Bạn mở menu Windows command prompt lên
Tiếp theo bạn nhập lần lượt từng lệnh sau vào và enter nhé
Chú ý:
- Ở đây tôi cài xampp trên ổ C , nếu bạn cài ở chỗ khác thì bạn thay đường dẫn tương ứng vào nhé.
- Nếu bạn dùng bộ cài đặt apache- PHP- Mysql độc lập thì bạn sửa lại đường dẫn phù hợp nhé.
schtasks /create /sc hourly /st 00:15 /tn mauticCronJob01 /tr "C:/xampp/php/php.exe C:/xampp/htdocs/mautic/app/console mautic:segments:update --env=prod" /ru "System"
schtasks /create /sc hourly /st 00:20 /tn mauticCronJob02 /tr "C:/xampp/php/php.exe C:/xampp/htdocs/mautic/app/console mautic:campaigns:rebuild --env=prod" /ru "System"
schtasks /create /sc hourly /st 00:25 /tn mauticCronJob03 /tr "C:/xampp/php/php.exe C:/xampp/htdocs/mautic/app/console mautic:campaigns:trigger --env=prod" /ru "System"
schtasks /create /sc hourly /st 00:30 /tn mauticCronJob04 /tr "C:/xampp/php/php.exe C:/xampp/htdocs/mautic/app/console mautic:messages:send --env=prod" /ru "System"
schtasks /create /sc hourly /st 00:35 /tn mauticCronJob05 /tr "C:/xampp/php/php.exe C:/xampp/htdocs/mautic/app/console mautic:emails:send --env=prod" /ru "System"
schtasks /create /sc hourly /st 00:40 /tn mauticCronJob06 /tr "C:/xampp/php/php.exe C:/xampp/htdocs/mautic/app/console mautic:email:fetch --env=prod" /ru "System"
schtasks /create /sc hourly /st 00:45 /tn mauticCronJob07 /tr "C:/xampp/php/php.exe C:/xampp/htdocs/mautic/app/console mautic:social:monitoring --env=prod" /ru "System"
schtasks /create /sc hourly /st 00:50 /tn mauticCronJob08 /tr "C:/xampp/php/php.exe C:/xampp/htdocs/mautic/app/console mautic:webhooks:process --env=prod" /ru "System"
Nếu sau mỗi lần enter mà thấy thông báo dạng: SUCCESS: The scheduled task "mauticCronJob08" has successfully been created. là bạn đã tạo thành công rồi nhé, nếu thấy bào lỗi thì bạn kiểm tra xem lỗi gì nhé. Đa số thường gặp là bạn không để dấu " " => sau khi tạo xong thì bạn tiếp tục trải nghiệm hệ thống nhé.
Chúc bạn thành công!
( DVMS )
Bí kíp khởi nghiệp (startup) tiết kiệm và hiệu quả >>
Một số cách tạo scheduled task chạy PHP trên Windows, bạn có thể tham khảo thêm
Solution-1 using Task scheduler
In your Windows 7/windows 2005/2008.
Go to Startmenu->All Programs->Accessories->System Tools->Task Scheduler->create Task
In the new window:
1. General (Give the Task name and for testing you can select “Run when User is logged in“)
2. Trigger (You can Select the running interval as “daily,weekly,monthly”. )
3. Action (This is most important part. Select a Mozilla firefox as the “program/script” and in the Argument provide the URL to fire with Mozilla firefox).
Solution-2 using Task scheduler and PHP from your XAMPP server
In Windows Xp,no need to copy or install anything(Already PHP is installed on the server like XAMPP)
Goto Task scheduler
Create a task give Running time, then in avanced setting option in the “RUN” command textbox type
C:\xampp\php\php.exe -f c:/xampp/htdocs/waytocode/mycron.php
In Windows 7/server 2005/2008
No need to copy or install anything(Already PHP is installed on the server)
Create a task give Running time in Trigger setting.Then in Action setting option in the “Program/Script” command textbox type
C:\xampp\php\php.exe
and in the “Add arguments (optional)” type
-f c:/xampp/htdocs/mycron.php
Solution–3 install a Windows exe file that will simulate the cron job from *nix system
I don't like to install any exe file to my servers or development machine, but I'll provide the solution as they posted:
In Windows Xp,Copy all 2 DLL file with wget.exe to the C:\windows folder
Create a task give Running time then in avanced setting option in the “RUN” command textbox type
C:\Windows\wget.exe -q -O NUL http://localhost/mycron.php
In Windows 7/server 2005/2008 ,Copy all 2 DLL file with wget.exe to the C:\windows folder
Create a task give Running time then in avanced setting option in the “Program/Script” command textbox type
C:\Windows\wget.exe
and in the “Add arguments (optional)” type
-q -O NUL http://localhost/mycron.php
Solution-4 using a .bat file and the task scheduler
I found it here at Stackoverflow and it is similar to the first 2:
1. Create a cron.php file (the code you want to execute at a regular interval)
2. Create a CRON.BAT file, copy and past the below code in the file
3. D:\xampp\php\php.exe D:\xampp\htdocs\Application\cron.php
4. The path I have written is according to my xampp and cron.php file, update the path of files according to your system directory
5. To schedule a task Click on start > All Programs > Accessories > System Tools > Scheduled Tasks
Or you can go directly Control Panel > Scheduled Tasks
Right click in the folder New > Schedule Task
Give appropriate name to the Task. In the RUN text field… Type the complete path of the CRON.BAT file in my case it is
D:\xampp\htdocs\Application\CRON.BAT
Set the schedule of the job, you can use advanced button if required.
Solution-5
I don't like it either because one script can't depend on someone else website but it is a solution anyway.
Use an external online cron job service.
https://www.google.ca/search?q=cron+job+online+service
Chose one solution that it is more appropriate for you. Hope this will help someone.
Solution-6 (Based on the answers below, and works with CodeIgniter too!)
Create the cron.bat file and write the following command and save it.
@ECHO OFF
c:
cd C:\Program Files\Internet Explorer
START iexplore.exe http://localhost/path/to/cron/job/1
Create a task give Running time in Trigger setting.Then in Action setting option in the “Program/Script” command textbox type
C:\xampp\path\htdocs\folder\includes\cron.bat
Phần mềm email marketing rất hay nên thử Mautic
Tất cả về Email Marketing 2.0
Có thể bạn chưa biết:
TUYỂN THỰC TẬP REACT NATIVE
* Trang bị kỹ năng về JS, lập trình hybrid app, sử dụng những công cụ hỗ trợ (VScode, github, sourcetree, ...)
* Thành quả mong muốn là các bạn tham gia sẽ có được kỹ năng lập trình hybrid app
Biểu mẫu đăng ký training tại đây >> http://bit.ly/2NK9YWd
TEAM MOBILE APPS - CTY DVMS