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
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
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
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
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
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
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
SVC(1) General Commands Manual SVC(1)
NAME
svc, ci, co, svclog - shell version control system
SYNOPSIS
ci [-lu] file
co [-l] [-r rev] file
svclog file
OPTIONS
-l For ci, checkin, checkout again, and lock file
-l For co, checkout file and then lock the archive
-u After checking in, do not delete the file
-r Check out revision rev instead most recent revision
EXAMPLES
ci -u file # Check in file
co -l file # Check out file and lock archive
co -r 2 file # Check out version 2
DESCRIPTION
Svc is the Shell Version Control system, patterned on RCS. It maintains a sequence of versions in archive files, so that new versions can
be checked in (added to the archive), and old versions can be checked out (made available). To create an archive for file, check it in
with the -u flag. This action will prompt for a log message and then create an archive called file,S in the current directory, or in the
subdirectory SVC if it exists. The file will not be deleted, but will be made unwritable.
To update the file, check it out with the -l flag. Then modify it, and check it back in, giving a new message when prompted. After this
process has been repeated many times, the archive will contain the entire history. Any version can be checked out using the -r flag. To
get a printout of the history, use svclog.
SVC(1)