MyBB Community Forums

Full Version: HOW TO: Automated database backups (1 line of code + cPanel)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
(2012-01-07, 04:05 PM)martec Wrote: [ -> ]Thanks...
work fine here...

have code to backup specific folder to mail?

You would have to compress the folder. To my knowledge you can only attach files, not directories.
(2012-01-09, 09:18 AM)KuJoe Wrote: [ -> ]
(2012-01-07, 04:05 PM)martec Wrote: [ -> ]Thanks...
work fine here...

have code to backup specific folder to mail?

You would have to compress the folder. To my knowledge you can only attach files, not directories.

yes...
i want script to first compress the folder after sent to my mail.

possible?

compressed forum directory is small... has only 4 mb...
small because i donĀ“t permit Attachment in my forum
Great script!!
Looking for something similar as martec - can i set up the script to backup only a specific folder?
(2012-01-26, 04:54 PM)cmoreira Wrote: [ -> ]Great script!!
Looking for something similar as martec - can i set up the script to backup only a specific folder?

i found solution...

tar -cvzpf /MY/BACKUP/LOCATION/BACKUPNAME.tar.gz /path/to/folder/

E-mail the backup:
To have the backup automatically e-mailed to you add this line to the file:

uuencode /MY/BACKUP/LOCATION/BACKUPNAME.tar.gz BACKUPNAME.tar.gz | mail [email protected]

Rest is same as http://community.mybb.com/thread-28950.html
I don't quite understand, these folders has to be in the FTP? Do they need to be in the web folder (I got mine named web from my webhost, it's where the index website is located).

I may try out soon

[EDIT]
This code, don't I need my user and pass for the database?
uuencode /MY/BACKUP/LOCATION/BACKUPNAME.sql.gz BACKUPNAME.sql.gz | mail [email protected]
wanted to say thanks for this. My command line fu is really rusty, but this helped a bundle. My provider doesnt have uuencode, but does have mutt (aliased to mail, with mutt invisible). Mutt allows me to use command line options to send attachments. So now I have used this info to build a script that backups up 5 different databases (wp, drupal, and mybb) and email them to me. I also have it create a tarball of all my hosting but that is too big to mail, so the text of the mail reminds me of where the tarball is dropped, ad all is good. I may try to integrate it with a dropbox account or something later and post updated info here.

Thanks again!
Got this error via email:

/home/MYDB/backupscript: line 1: /home/MYDB/backup/BACKUP.sql.gz: No such file or directory
mysqldump: Got errno 32 on write

Where:
MYDB is my database name
backupscript is the script (former .txt)
backup is a folder where I want to have my backups saved.

Thanks for your help.
This is excellent , appreciate the authors work.

I have an idea, i'm sure some plugin developer tries it :-)

Using the above automated backup or utilizing mybb core database backup one could device a plugin which automatically send the generated backup to dropbox using its api access app.

Here is well explained dropbox backup code and explanation :
inboundhorizons.com/use-php-and-dropbox-api-to-automatically-backup-mysql-databases-to-dropbox/

now is that so hard to device a plugin and make life easier :-) !

so this will:
- backup /uploads/ folder
- backup full database

all above is compressed zip and sent to dropbox

EDIT: making developers life easier.
Here is a similar plugin which backup's database and all host files and sends them to external FTP server.
http://community.mybb.com/thread-110065-page-2.html

Dev' needs to mod it little bit,
- we only need /uploads/ folder and the DB backup Smile
- remove ftp and implement dropbox Smile

seriously if i were a mybb plugin developer i would had compiled it and attached to the board immediately as for testing etc, and after all beta tests i would had applied on plugins page for publishing
Pages: 1 2 3 4 5 6 7 8 9