The argument for a full backup is -A... do mysqldump --help.
Thanks, my another problem is how to make sure backup file is proper or not.
I userd the command to take backup us mysqldump -A -p --password=***** >back.sql
backup.sql file created but file having lot of junk character. How to make sure?
It's not suppose to have "junk", because it's a text file... maybe the command is corrupted or you have some weird data on your tables...
Use mysqlcheck to check your DBs before the dump...
Here is a way to email a backup using bash, perl, and crontab.
mysqlbackup
Code:
#!/bin/sh
mysqldump -uroot -ppwd --opt db1 > /sqldata/db1.sql
mysqldump -uroot -ppwd --opt db2 > /sqldata/db2.sql
cd /sqldata/
tar -zcvf sqldata.tgz *.sql
cd /scripts/
perl emailsql.cgi
Use perl to send a MIME email.
emailsql.cgi
Code:
#!/usr/bin/perl -w
use MIME::Lite;
$msg = MIME::Lite->new(
From => 'mysqlbackup@yoursite.com',
To => 'you@yoursite.com',
Subject => 'sqldata.tgz MySQL backup!',
Type => 'text/plain',
Data => "Hi You,\n MySQL database backups.");
$msg->attach(Type=>'application/x-tar',
Path =>"/sqldata/sqldata.tgz",
Filename =>"sqldata.tgz");
$msg->send;
Use crontab -e to edit your schedule to run at 2 am every day.
I have a ksh shell script and i need to pass arguments which are generated by data pulled from a database.
When the argument to the shell script is too long (about 4000 charecters) the below is the issue observed.
I copy the command which is 4000 charecters long from the logs and paste it... (7 Replies)
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)
Hi All,
I need to know RedHat linux version installed on a different servers.
I know uname -a or /proc/version
Is any other command to know the Linux version????
When we telnet to any of the Linux server, the version shows very clearly like
Red Hat Enterprise Linux ES release 3 (Taroon... (1 Reply)
hello,
i'm trying to figure out the size of a mysql database shelling into my server with putty / command line.
is there / are there any commands that will return the size of a database, in MB?
thanks. (4 Replies)
Does anyone know how to get mysql up and running with the installed version that comes with redhat linux?
I've spent hours with no progress.
Thank you (13 Replies)