SHELL =/bin/bashPATH =/sbin:/bin:/usr/sbin:/usr/binMAILTO = rootHOME =/# run-parts01 *** rootrun-parts/etc/cron. hourly024 *** rootrun-parts/etc/cron. dailypolic** 0rootrun-parts/etc/cron. w
SHELL =/bin/bash
PATH =/sbin:/bin:/usr/sbin:/usr/bin
MAILTO = root
HOME =/
# Run-parts
01 *** root run-parts/etc/cron. hourly
02 4 *** root run-parts/etc/cron. daily
22 4 ** 0 root run-parts/etc/cron. weekly
42 4 1 ** root run-parts/etc/cron. monthly
01 8 *** root/home/www/db_back/bk. sh
10 8 * root/opt/lampp/bin/php/home/www/deleteOldDB. php
/Opt/lampp/bin/php is your php installation directory. You can set it based on your server.
You can first try to execute the. php file in the shell on your server. If so, this directory can be used.
Such as: cd/opt/lampp/bin press ENTER
Xxxxx $:./php/var/www/test. php
If you can execute it, you can use this directory, the server version is different from the directory, Ubuntu to install php5-cli can be used.
Then you can edit the crontab file. The code above vi/etc/crontab is.
I have a lot of online information about # bath... and so on in the php file. I tried it and can execute it without adding it ,.
/Opt/lampp/bin/php: the php Execution file to this directory. Use this file to execute the absolute target. php file, such as the/home/www/deleteOldDB. php file.
You can also access the directory XXXX #: cd/opt/lampp/bin/php in shell and enter./php/home/www/deleteOldDB. php.
In this way, you can access the php file. If you cannot access the php file here, the scheduled execution will not be able to be executed.