Script for automatic back up of database for cron jobs?

Started by Farmacija, February 16, 2007, 12:24:07 PM

Previous topic - Next topic

Daniel15

SleePy, I suggest you add a shebang line to the top of the file...
Above <?php, put:

#!/usr/bin/php -q


Then, just use the file path (without the php -q) in the cron job :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Farmacija

you confusing me, which code i should use in cron jobs when i use daniel15's script for more then one databases? :)
www.farmaceuti.com
www.farmaceuti.com/tekstovi

Daniel15

If you use my script above, first edit the script to reflect the correct values (username, password, databases), and then change the cron job to something like /home/cpuser/database-backup.php :).
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Farmacija

#23
i don't need to put this mysqldump -ucpuser_username -ppassword  cpuser_database > before /home/cpuser/database-backup.php?


I get this error => /bin/sh: /home/farmaceu/database-backup.php: Permission denied

edit2=> now it's ok, it was needed to chmod file database-backup.php to 744.
thank u very much daniel!!!  :)
www.farmaceuti.com
www.farmaceuti.com/tekstovi

Daniel15

#24
No problem ;)

Quote from: Farmacija on April 27, 2007, 04:18:52 AM
i don't need to put this mysqldump -ucpuser_username -ppassword  cpuser_database > before /home/cpuser/database-backup.php?
No, you didn't need to do that, as the PHP script does the mysqldump call itself :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Farmacija

#25
yes, i figure it out :)

--
But, now i have this error
Failed loading /root/milan/ioncube/ioncube_loader_lin_4.4.so:  /root/milan/ioncube/ioncube_loader_lin_4.4.so: cannot open shared object file: Permission denied
www.farmaceuti.com
www.farmaceuti.com/tekstovi

Farmacija

Me again.

Now i have problem because back up file is huge, in a last time it was about 8gb???


Does someone know where is the problem?

www.farmaceuti.com
www.farmaceuti.com/tekstovi

Advertisement: