Mysql Backup – The simple script

There is only ONE  “Golden Rule of IT” : BACK IT UP OR LOOSE IT..

1)There is no such thing as security, be it firewalls, hard drives that spin in the speed of light and have 324 years guarantee or even a pact with western digital’s CEO…When it comes to crucial data stored in databases the only thing you can rely on is a : BACKUP.

2)Testing that the precious backup, you are hiding away in the swiss vault somewhere, is ACTUALLY working will prove beneficial in the long run.

And thats it.

Here is a really simple script that works in virtually every linux distro have come across and produces nice gziped backups of MySql databases.

Enjoy!

################################################################
#!/bin/bash
#18/12/2003
#Simple script to backup a specific database
#Backup script by datetime
#USE AT YOUR OWN RISK
### MySQL Server Login Info ###

DB=”Important_DB_Name_Here”

MUSER=”root”
MPASS=’mypasswd’
MHOST=”localhost”
MYSQL=”$(which mysql)”
MYSQLDUMP=”$(which mysqldump)”
BAK=”/mysqlbackups”
GZIP=”$(which gzip)”
NOW=$(date +”%d-%m-%Y”)

[ ! -d $BAK ] && mkdir -p $BAK

##ACTUAL WORK TAKES PLACE HERE##
FILE=$BAK/Desired_static_namepart-$NOW.gz
$MYSQLDUMP -u $MUSER -h $MHOST –password=$MPASS $DB1 | $GZIP -9 > $FILE

#########################################################################
# Uncomment the following line to delete files older than 10 days in the backup directory
#find  /mysqlbackups/* -mtime +10 -exec rm -f {} \;

#########################################################################

301 Redirect – Moving To A Better Place…

Moving to a new domain and don’t want lose your hard earned traffic and search engine rankings?

Keep reading…

What will follow is a nice way to push http clients (browsers and spiders alike) over to a different domain,

and make the spiders drop the old records that they have in their index and replace them with the new ones that you will “serve” them.

Be warned though that it takes time for them to rebuild their index. The best option is to have the old domain up and running for at least 6 months after you do the transfer.

  • What Is A 301 Status Code?

What we need is our server to present to everyone an http header with a 301 status code, which means that whatever they were looking for has permanently moved to a new location and we provide the location at the same time.

  • What Is An .htaccess File?

When a visitor or a spider requests a web page, your web server (Apache) checks for an .htaccess file.

The .htaccess file contains specific instructions like redirection issues, security and how to handle certain errors.

You will have to create an .htaccess file at the top level directory (Document Root).

Linux Ex.:/usr/local/apache/htdocs/

Windows Ex.:C:\apache\htdocs\

  • Requirements:

Apache Web Server

Rewrite_Mod Enabled (Every serious hosting company has that on)

Enough With The Theory…Hand Over The code 🙂

Ok.Your .htaccess file on the old domain would be:

————————————————————————–

Options +FollowSymLinks

RewriteEngine on

RewriteBase /

RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain\.com

RewriteRule (.*) http://www.yournewdomain.com/$1 [R=301,L]

Redirect PERMANENT /forum/ http://www.yournewdomain.com/forum/

—————————————————————————

Keep in mind that the URLS are case sensitive.

You can make it work for directories too. Say you have a forum on a folder one level deeper

then your htdocs.

That is what the last line does and by adding the PERMANENT flag has the same effect as [R=301] in the line above.

  • Beware The Old Man

You should be aware though for there is indeed such a thing called domain age.

Search Engines know how old a domain is.

Google for example uses it as one of their main criteria, along with content, linking from other sites, etc…

For more information about .htaccess, rewriting_mod, rules and directives you should check the Apache web site.

That’s all folks 😀

All the truth about the article : World shame in COSTA RICA – Poachers

Hello everybody!

I have been receiving this email on the Costa Rican Ostional egg collection from many of you and I just wanted to make things a little clearer for those who arent aware of the situation at the refuge and who at first site may have been shocked by the photos.

I present to you the amazing Olive Ridley (Lepidochelys olivacea). This is a species of marine turtles that is threatened on the IUCN list and classified as “Vulnerable”. On the CITES (Convention on International Trade in Endangered Species of Wild Fauna and Flora) it is classified in Appendix I, which means that trade in specimens of these species is permitted only in exceptional circumstances.

The Ostional Wildlife Refuge in Costa Rica was created in 1984 to protect one of the world’s most important nesting beaches for the Olive Ridley. It is also the only place in the world that the government allows poaching of the turtle eggs. To understand this you need a little background info on the Olive Ridley behaviour as it sounds completely absurd I know.

Olive Ridley Nesting Behaviour:

This species of turtle nests in groups as well as solitary. The nesting beach of Ostional accomodates one of the largest mass nesting occurence in the world. This is called an “Arribada” in spanish, which means “Arrival” and it can last from 3 to around 7 days. They occur year round, usually once a month but sometimes two and the peak is during the rainy season (Aug-Dec). They choose the beginning of the last quarter of the moon cycle and in those few days they appear in hundreds and sometimes thousands on a small stretch of beach. The main arribada area at Ostional covers about 800m. As a result millions of eggs are laid by the female turtles with not enough space to accomodate them all. Most eggs on the first night are destroyed by subsequent turtles who dig up the previous nests, bringing hundreds of eggs back up to the surface, only to rot away without any hatching success. The largest arribada occured in 1995 where 500,000 females came ashore to nest, so you can imagine!

Management Plan:

Since 1987 the costa rican government decided to allow a temporary suspension of the international ban on turtle egg taking, allowing therefore the local community to harvest the doomed eggs on the first two dawns of an arribada. The beach was then cleared from the rotting eggs that could affect the healthy ones in the ground from the developing bacteria etc. With the goal of making rational use of 1% of the egg resource in exchange for protection, the community organised itself acquiring legal status in 1987, promoting the development of community services through an alternative economic scheme. In return the community must help with conservation efforts, such as protecting the turtles by cleaning debris from the beaches and controlling the amount of vegetation on it, helping with patrol duties during the day and night to prevent illegal poaching and helping the baby turtles reach the sea unharmed. 70% of the profits are distributed to the ADIO (Association for the Intergrated Development of Ostional) members and 30% is spent in operating expenses, scientific research, grants for students in the community, sports, community events, environmental education, primary schools and other community activities. Other projects funded by this income from the eggs are to help local schools, road maintenance, scholarships to low income students, aid to senior citizens of this community and to help sustain ADIO’s conservation projects. This shows mutual benefit for both the community and for the turtles. The socioeconomic status of the entire community has increased in this area and proper management of the turtle population can be carried out. Egg removal is low relative to the total number of eggs laid, so this management plan does not seem to impact the adults at all, in fact the number of nests have increased since 1970, together with the hatching success rate.

Whether this will work out in the long term, well, we will just have to wait and see. For those of you who have managed to read down to here and are interested to find out more information, I have given some useful sites with info on the olive ridley, that might help:

http://www.iucnredlist.org/apps/redlist/details/11534/0
http://www.aseanbiodiversity.info/Abstract/51009900.pdf
http://www.seaturtle.org/mtn/archives/mtn86/mtn86p6.shtml
http://www.seaturtle.org/PDF/author/Campbell_1999_AnnTourRes.pdf
http://www.iucnredlist.org/documents/attach/11534.pdf
http://www.nicoyapeninsula.com/ostional/
http://www.hoax-slayer.com/costa-rica-turtle-eggs.shtml

Stamatina Skliros,
Biologa y Coordinadora de Investigacion,
Programa de Proteccion de Tortugas Marinas,
Estacion Las Tortugas,
Costa Rica

http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7812.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7918.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7934.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7907.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7904.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7945.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7921.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7937.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7938.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7895.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7964.JPG
http://www.aldia.cr/galerias/tortugasostional/slides/MVQ_7759.JPG