Sponsored Content
Top Forums Shell Programming and Scripting Script - Mysql backup and delete Post 302593928 by amlife on Monday 30th of January 2012 01:30:19 AM
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.
 

6 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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
RANLIB(5)						      BSD File Formats Manual							 RANLIB(5)

NAME
ranlib -- archive (library) table-of-contents format SYNOPSIS
#include <mach-o/ranlib.h> DESCRIPTION
The archive table-of-contents command ranlib creates a table of contents for archives, containing object files, to be used by the link-editor ld(1). It operates on archives created with the utility ar(1). The Ranlib function prepends a new file to the archive which has three separate parts. The first part is a standard archive header, which has a special name field, "__.SYMDEF" or "__.SYMDEF SORTED". If the archive does not have multiple members that define symbol then "__.SYMDEF SORTED" should be used and the table of contents should be sorted by name. The second part is a ``long'' followed by a list of ranlib structures. The long is the size, in bytes, of the list of ranlib structures. Each of the ranlib structures consists of a zero based offset into the next section (a string table of symbols) and an offset from the begin- ning of the archive to the start of the archive file which defines the symbol. The actual number of ranlib structures is this number divided by the size of an individual ranlib structure. The third part is a ``long'' followed by a string table. The long is the size, in bytes of the string table. SEE ALSO
ar(1), ranlib(1) Darwin November 16, 2001 Darwin
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy