1. Requirements: Perform database backups regularly
2. Create a new scheduled task entry file named cron.php (same level directory as index.php)
About $ARGV
Test cron.php
Indexcontroller AA operation method under Home module
First look at the PHP command location
Executes the command through M c A in the cron.php, thus calling the home module under the index controller AA operation method
3. Add a croncontroller.php to the admin module
Execute crontab command
Crontab-e
Back up the database every 10 minutes
At this point, the scheduled task has been done to implement database backup
Note: There is actually a pit, and I added PHP to the system command
cp/opt/lampp/bin/php/usr/sbin/
But the crontab-e is still going to write the full command address.
Mysqldump This command in Croncontroller to write the full command address.
ThinkPHP3.2.3 database backup and Scheduled tasks