Portal Home > Knowledgebase > Articles Database > Copy Data


Copy Data




Posted by 3FRSB, 10-27-2013, 11:48 AM
Hi, I'm looking a script. What a script does is: 1. Stop mysql. Sleep about 30 sec. 2. Copy file and sub-dir in /var/lib/mysql (using rsync or scp ) 3. Sleep 30 sec. 4. Start mysql back. Anybody can help me with that? Thanks.

Posted by Hannan, 10-27-2013, 12:27 PM
like doing once a day? like backup?

Posted by serve-you, 10-27-2013, 01:23 PM
Just use mysqldump and rsync over ssh. Simple.

Posted by 3FRSB, 10-27-2013, 09:05 PM
Yes, sir. I'm not expert about scripting.

Posted by serve-you, 10-27-2013, 09:22 PM
Here's a pretty simple script that I used to use. You could run something like this on a nightly cronjob.

Posted by Kailash12, 10-28-2013, 01:28 AM
If you are looking to take backup, you do not need to stop the mysql service (and it is not a good idea as well). You can use mysqldump to generate the sql dump of all your databases and then you can copy your backups. The script provided by @serve-you should work for you.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Poundhost down (Views: 775)
Bi-Weekly Cron (Views: 757)
Help Please (Views: 656)


Language: