Script - Mysql backup and delete


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script - Mysql backup and delete
# 1  
Old 01-30-2012
Script - Mysql backup and delete

Hello

I have a production mysql server and archive server, unfortunitly its not possible to setup repliacation between the two, the reason is that the archive server is using some fancy storage engine which doesn't allow mysql replication.

I'm trying to write a script using perl that does the following.

1. dump database data into csv (so the archive server would understand). [Got this part done]
2. load table ids from csv file into array [ got this part done]
3. load table ids from archive server into another array [ got this part done]
4. compare both arrays and import only matching ids in the csv file [not working write]
5. delete all imported ids from prod server.


I'm not sure if this is the best way to do it, I would appreciate any thoughts or recommendations on I can get this task done.
# 2  
Old 01-30-2012
provide the sample of both csv files and tell us your expect output.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

MySQL & OpenLDAP - file level backup

Hi All, The MySQL & OpenLDAP database on my Debian are very lightly updated. Usually I tar everything on / including the databases. The restore works OK on another machine. I want to know whether its safe to do file level backup of databases like this ? Do the MySQL & OpenLDAP databases... (0 Replies)
Discussion started by: coolatt
0 Replies

2. Web Development

Restore MySQL backup

Hello all! First posting here! So be patient with me. I made a clean install with MacOS 10.8 and need to restore my Databases from my external backup drive. Apparently it is not possible, to create the MySQL user and password as before, and simply drag the databases from... (12 Replies)
Discussion started by: marek
12 Replies

3. Shell Programming and Scripting

MySQL Restoration Backup Script

Hi there, Alright I have this line that I'm working with (bash programming): mysql -u username -pHASH ${args} < /home/site/backups/site.${args}.sql I get this error on that line: ./restore.sh: line 51: syntax error near unexpected token `newline' ./restore.sh: line 51: `mysql -u... (5 Replies)
Discussion started by: Pandoula
5 Replies

4. Shell Programming and Scripting

Help with perl mysql backup script

Hi, im trying to make a script that backups mysql databases but apparently I am having trouble with the variables, or simply something I am missing. Would appreciate any help, here is the script #!/usr/bin/perl -w use strict; require File::Spec; #VARIABLES my $databasename =... (4 Replies)
Discussion started by: Fireline
4 Replies

5. Shell Programming and Scripting

How to backup a particular Database in MYSQL?

Hi All, Thanks in Advance!! How to backup a particular Databases..through Bash script!! For example i have 6 databases; Anish linux Software Questions Rhce Google these are the databases i have from that i want to take "Anish" and "questions" database backup regularly.... (4 Replies)
Discussion started by: anishkumarv
4 Replies

6. UNIX for Advanced & Expert Users

MYSQL command to take a backup of the database in Redhat linux 7.2

I am new to mysql database , we have a mysql database running on linux , and we use mysql database for bugzilla, so we wanted to take a backup . what is the command for taking the entire database backup from the command prompt with all options. Thanks in advance Bache Gowda (4 Replies)
Discussion started by: bache_gowda
4 Replies
Login or Register to Ask a Question