mailRe: bash script for a mysql dump of the newly create relax wiki


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Troels Emtekær Linnet on July 17, 2013 - 18:03:
If (110) means it try that port,
that port number is for POP mail?

Can you configure to port: 3306

Troels Emtekær Linnet


2013/7/17 Edward d'Auvergne <edward@xxxxxxxxxxxxx>:
Hi Troels,

I have the MySQL script up and running on one machine (with the
private details).  But on a different machine, my computer at the MPI
in Goettingen, I see:

###########################
STARTING on: 15:37:32 20130717
Base dumping...
mysqldump: Got error: 2003: Can't connect to MySQL server on
'mysql13.gigahost.dk' (110) when trying to connect
-- Command failed; exit 1
Compressing base...
-- Command successfully executed
Done, quit!


This work machine is the second machine I would run the cronjob on as
the machine is always on.  But this looks like mysqldump is being
blocked.  Is there anything I should know about the MySQL server?  Do
you know if it uses a non-standard port?

Cheers,

Edward




On 16 July 2013 17:46, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:
Cheers!  I have added the script to the devel_scripts/ directory in
the relax base directory.  I will also set this up as a cronjob on a
number of machines to dump every day sometime during the night.  If
the load on the server is too high, I can stagger the dumping or set
it to weekly dumping.

Regards,

Edward


On 16 July 2013 17:40, Troels Emtekær Linnet <tlinnet@xxxxxxxxx> wrote:
Dear relax developers and users.

I hereby send a bash script for a mysql dump of the newly create relax 
wiki.
Thereby the mysql database can easily be created anywhere else.

To prevent abuse of the webpage hosting service, I need to keep the
password secret.

The password is shared with Edward d'Auvergne.

I suggest a setup, where Edward run a cronjob a his infrastructure, and
expose the files to:
http://download.gna.org/relax/wiki/mysqldump

I am looking into a FTP dump as well.

Best
Troels Linnet


----------------------
#!/bin/bash
# -*- coding: UTF-8 -*-
# Script for dumping MySQL base automatically using cron.

# exec test
exec_test () {
[ $? -eq 0 ] && echo "-- Command successfully executed" || echo "--
Command failed; exit 1"
}

# Filenames
dbhost="mysql13.gigahost.dk"
# The following three fields are kept secret, to prevent abuse.
# Please contact Troels Linnet at: tlinnet _at_ gmail dot com, for access.
dbuser="secret"
dbpwd="secret"
dbname="secret_nmrrelax"
backupfolder="$HOME/backup/mysqldump"
mkdir -p $backupfolder
mydate=`date '+%Y%m%d_%H%M'`
mytime=`date '+%T %Y%m%d'`
filename1="${backupfolder}/${dbname}_${mydate}.bck.sql"

# Logging
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3
exec 1>>${backupfolder}/${dbname}.log 2>&1
# Everything below will go to the log file

dump_base () {
    echo "###########################"
    echo "STARTING on: $mytime"
    echo "Base dumping..."
    mysqldump --opt --host=$dbhost --user=$dbuser --password=$dbpwd
$dbname > $filename1
}

compress_base () {
echo "Compressing base..."
    gzip -f9 $filename1
    # rm filename1
}

dump_base ; exec_test
compress_base ; exec_test

echo "Done, quit!"

_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel



Related Messages


Powered by MHonArc, Updated Wed Jul 17 18:20:11 2013