Drew Posted March 10, 2010 Share Posted March 10, 2010 Hello guys and girlsI am trying to set up cron tab to back up my data base every day or ever week, but I really don't have a clue what I'm doing, would any one be able to provide a little step by step of how to do it, I'm currently using site ground as my hostAlso using crontab can it be told to save my backups to my computer or will it auto save to the webserver? If so can it be told to save to two different webservers? Link to comment Share on other sites More sharing options...
PointandStare Posted March 10, 2010 Share Posted March 10, 2010 Depending on your set up you could use something like this which will gzip a copy of your database and email it to the address you specify:CAPITALS are to be completed with your details -/usr/bin/mysqldump -ce --user=USERNAME --password=PASSWORD DATABASENAME | gzip | uuencode NAMETOBESAVEDAS.sql.gz | mail -s "EMAIL SUBJECT" [email protected]Then set it to:Which means send it to me every Sunday0 0 * * 6BUT before you do anything speak to your host. 1 Link to comment Share on other sites More sharing options...
Drew Posted March 11, 2010 Author Share Posted March 11, 2010 thanks very much, sadly site ground has some of the worst customer care i have ever incountered, so ill play around and see what happends thank you very much Link to comment Share on other sites More sharing options...
Bejo Posted September 21, 2012 Share Posted September 21, 2012 i tried but only got empty text. did it work with ps 1.5 ? Link to comment Share on other sites More sharing options...
vekia Posted September 21, 2012 Share Posted September 21, 2012 I've got application for automatic mysql backup and putting it into google drive I will write module for presta which can do it directly from shop 1 Link to comment Share on other sites More sharing options...
Sickboards Posted February 1, 2014 Share Posted February 1, 2014 Hi Vekia, Did you ever create this module, I could not find it on your site. Link to comment Share on other sites More sharing options...
scottstephen Posted February 1, 2014 Share Posted February 1, 2014 I use a simple bash script to backup the DB. Note, that it doesn't matter which version of Prestashop you are using, this is related strictly to MySQL. Put the following into a .sh file and make it executable. #============== #!/bin/bash #date du jour DATE=`date +%Y%m%d_%H%M%S` mysqldump --add-drop-table -u db_username -pdb_password database | gzip > /home/backup/$DATE"_filename".sql.gz #============== This will create a full backup of the specified DB and gzip it. Of course you will need to specify a correct path for the destination file. Then you can add it to crontab with the following. crontab -e 00 00 * * * /usr/local/sbin/backup_script.sh This will run your backup script daily at midnight. Hope that helps. Link to comment Share on other sites More sharing options...
vekia Posted February 2, 2014 Share Posted February 2, 2014 now after some time i also use bash script to mysql dump, in addition i added feature to upload files to dropbox: solution here: http://www.webupd8.org/2013/01/dropbox-uploader-bash-script-useful-for.html 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now