php - How to run [Codeigniter] migration using cron Jobs?
Get the solution ↓↓↓Solution:
you have to provide path to php.exe then the function path.
i assumed you have php version 5.3,
/opt/php53/bin/php /home4/shah/public_html/proof/oinvoices/index.php migrate reset
/opt/php53/bin/php /home4/shah/public_html/proof/oinvoices/index.php migrate latest
if you like to run a single cron job ,first make a function in migration:
public function clean_up(){
if (!$this->migration->version(0)) {
echo $this->migration->error_string();
}
// unset table cache - this will force it to update
unset($this->db->data_cache['table_names']);
if (!$this->migration->latest()) {
echo $this->migration->error_string();
}
}
then:if you are using php5.3
/opt/php53/bin/php /home4/shah/public_html/proof/oinvoices/index.php migrate clean_up
if you are using php5.4
/opt/php54/bin/php /home4/shah/public_html/proof/oinvoices/index.php migrate clean_up
hope it solve your problem .
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: unable to determine current zabbix database version: the table "dbversion" was not found.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.