Backup job for C5

Permalink
Here is the Beta 6 of the backup job.
this one is writed un bash and working on unix/linux only ( MySQL 5 or greater and MyISAM engine).

This job will make a complete backup of your files, optimize your
database and dump it table by table AND in one shot.
A mail will be send to you with link to download your backups.

There backups are stored in a protected folder with random login and
password to let you to download them.

To DOWNLOAD it: (click on the "télécharger" link of the EN version)
http://board.concrete5.fr/viewtopic.php?p=83#83...

cali
 
synlag replied on at Permalink Reply
synlag
Hey cali,

good work!

Backup and import perform well.

Greetz
cali replied on at Permalink Reply
cali
i tried to simplify as max as it could be to have a faster exporting/importing SQL dump file.

please to know that it could be useful :)
synlag replied on at Permalink Reply
synlag
have you tried to import an existing sql dump from a local set-up exported sql file through the web?
Does it work at yours?

Another thing is that the job is running since two hours, how can i stop it ;) ?
cali replied on at Permalink Reply
cali
yes the restore is working by the shell not phpmyadmin it's an sql serveur dump with lock table and co.
not a phpmyadmin dump.

to restore:
To import the the MySQL data generated, you can use there commands in a shell:

mysql -u username -ppassword database_name < FILE.sql


for exemple

with replacing [database] by your database name and backup-file.sql by your table backup file name

this kind of dump is the more rapid one to export and import for SQL server.
You can chack mysqldump doc on mysql web site.

in another way the backup is quite quick. it's running almost for 15min if you have a large web site.

and no there is no way to stop the command in execution.

your question is quite interesting. i'll think about to have a phpmyadmin export file format.
but to abort the command i don't think i'll can do anything. i'll think about too.

see you.
cali replied on at Permalink Reply
cali
ok i've just tried with phpmyadmin, it's working but it's quite long instead of mysql command.

then (i explain for those who don't know as well phpmyadmin):

in phpmyadmin select your database (phpmyadmin only import the file content).
then click on IMPORT button at the top of the page.
choose your file and click to execute button.

by the shell there are two way to do it after to have uploaded the file on your server.

by mysql standard command:
mysql -u USERNAME -pPASSWORD DATABASE < BACKUP.sql


or by mysqlimport command:
mysqlimport -vvf DATABASE BACKUP.sql


if you don't exec this command in the same folder of the backup file write the absolute path to this one like for exemple:
mysql -u USERNAME -pPASSWORD DATABASE < /var/www/my_account/my_vhost/my_bkp/BACKUP.sql


you can also use this kind of script to import big database:
http://www.ozerov.de/bigdump.php...
if you don't like or cannot use shell terminal on your web hosting service.

personnaly i'm using this backup job on many different sites built with C5 and never had problem to export and import.
synlag replied on at Permalink Reply
synlag
many thanks for this detailed explanation and the tips.

best regards
bryanlewis replied on at Permalink Reply
bryanlewis
I'm not getting a e-mail back... is there something I did wrong... I put the files in the right spot and typed in my email... but everytime i run the job I never get anything back
cali replied on at Permalink Reply
cali
i have some questions to nderstand the environnement:

1- what is your OS ?
2- have you got a shell access to perform some test ?
3- are the folder created on your ftp ?
4- are the archive created in the folder ?
5- is your email correctly set ?
bryanlewis replied on at Permalink Reply
bryanlewis
1. don't know, how do i find out?
2. no
3. no
4. no
5. yes
pixelfish replied on at Permalink Reply
pixelfish
Using Linux server with CentOS. dont have shell access and not sure about the folder or archive i am meant to create?? Also the email is correctly set.

thanks
cali replied on at Permalink Reply
cali
hi i have to come back on the code this is quite old.
i'll check all of it on monday and come back to you.

is the folder correctly created ?
do you have sendmail on your server ?