0) Backup your database.
You should probably be doing this already. Now’s a good time to make sure that your backups ran.
1) Create the script.
You’ll need the correct permissions to query the database. Here’s the command. Be sure to change <DATABASE_NAME> as it fits.
# mysql -p -e “show tables in <DATABASE_NAME>;” | \
tail –lines=+2 | [...]
Posted on July 11th, 2010 by Denie
Filed under: BASH, CentOS, Linux, MySQL, Tutorials | 2 Comments »
/usr/local/bin/mysql.backup.sh
#!/bin/bash
NOW=$(date +”%m-%d-%Y”)
OLD=$(date +”%m-%d-%Y” –date=”3 days ago”)
PROJECT=”project_name”
LOCATION=”/home/backup”
FILE=”$PROJECT.$NOW.sql”
FILE2=”$FILE.gz”
FILEOLD=”$PROJECT.$OLD.sql.gz”
EMAIL=”youremail@domain.com”
$SQLUSER=”username”
$SQLPASS=”password”
$SQLNAME=”database_name”
cd $LOCATION ; \
rm -f $FILEOLD ; \
mysqldump -u $SQLUSER –password=$SQLPASS $SQLNAME > \
$LOCATION/$FILE ; \
gzip $LOCATION/$FILE ; \
echo “Backup location is in $LOCATION/$FILE2″ | \
mail -s “[$PROJECT] MySQL Backup” $EMAIL
Then you can put it on your cron (background process)
Below cron will execute the script on Saturday at 12AM:
0 0 [...]
Posted on July 4th, 2010 by Denie
Filed under: BASH, Linux, MySQL | No Comments »
When invoked without arguments, the date command displays the current date and time. Depending on the options specified, date will set the date and time or print it in a user defined way. I’ve seen many people writing a perl script for calculating yesterday or tomorrow. Computer loves numbers but we love relative terms like [...]
Posted on June 29th, 2010 by Denie
Filed under: BASH, Linux, Tutorials | No Comments »
Q. How do I format date to display on screen on for my scripts as per my requirements?
A. You need to use standard date command to format date or time for output or to use in a shell script.
Syntax to specify format
date +FORMAT
Share this on :
Facebook
Friendfeed
Posterous
Tumblr
Twitter
Posted on June 29th, 2010 by Denie
Filed under: BASH, Linux, Tutorials | No Comments »
This is a quick walk through on how to set up domain keys on Centos 5 using sendmail. It should also be very similar for Redhat or Fedora.
Domainkeys is a method mostly used by yahoo to verify that the sender of an email is valid. I did notice that gmail changes the domainkeys header line [...]
Posted on March 9th, 2010 by Denie
Filed under: BASH, CentOS, Linux, Sendmail, Tutorials | No Comments »
First, Squid server installed (use up2date squid) and configured by adding following directives to file:
# vi /etc/squid/squid.conf
Posted on December 18th, 2009 by Denie
Filed under: BASH, Linux, Tutorials | No Comments »
Most of them involve changing the daemon’s configuration in /etc/sendmail.mc and rebuilding sendmail.cf
Specific things that can affect performance:
dnl # Sendmail, Chap 24.9.13, Page 955
dnl # Disable re-write of queue control file (will result in duplicates
dnl # if the daemon is interrupted during a delivery)
define(`confCHECKPOINTINTERVAL’,`0′)dnl
Posted on December 9th, 2009 by Denie
Filed under: Linux, Sendmail, tips | No Comments »
If you would like to have a set of web pages that are protected, requiring a username/password to gain access, this tutorial will show you how to set it up. This is geared towards the Unix Apache httpd servers used on holly, lamar, and www.colostate.edu. If you are using another web server, you’ll need to [...]
Posted on November 24th, 2009 by Denie
Filed under: Apache, BASH, Linux, Tutorials | No Comments »
If you’re going to be doing a lot of Geotargeting or IP Address Lookups, please take a feed instead which will preserve both our bandwidth and your bandwidth.
Simple GET
That said, there is an easy HTTP oriented API to locate IP addresses and Geocode them. If you don’t supply the “?ip=aa.bb.cc.dd” bit, [...]
Posted on October 22nd, 2009 by Denie
Filed under: BASH, Linux, Scripting, Tutorials | No Comments »
Source: [click here]
Max 30 mins work.
However, life is rarely so simple.
yum search dkim didn’t find anything.
So, based on what I could find, I ended up here. Downloaded dkim-filter
2.4.1 and went on an epic voyage of discovery into the RFCs and other stuff.
I just want to install, configure and run the thing!
Posted on August 15th, 2009 by Denie
Filed under: Linux, Sendmail | 1 Comment »