In this example, each database will be stored separately and like earlier example we will save all databases and we will have the last 4 copies.

#Simple mySQL backup script for cron – updated version

# Modify the following to suit your environment
export DB_BACKUP=”/home/user/mysql_backup”
export DB_USER=”root”
export DB_PASSWD=”***********”
export DATE=”`date +”%d%b”`”
export MYSQL=”/usr/bin/mysql”
export MYSQLDUMP=”/usr/bin/mysqldump”

# Backup part
echo “mySQL_backup”
echo “———————-”
echo “* Rotating backups…”
rm -rf $DB_BACKUP/04
mkdir $DB_BACKUP/01

cd $DB_BACKUP/ && cd $DB_BACKUP/01
$MYSQL -u $DB_USER –password=$DB_PASSWD -Bse ‘show databases’ |while read m; \
do $MYSQLDUMP -u $DB_USER –password=$DB_PASSWD `echo $m` > `echo $m`.sql;done
bzip2 *sql

echo “* Creating new backup…”
echo “Backup done! `date`” > /tmp/my_report.log

# You can set the script to send you mail when backup it’s finished.
mail -s “MySql Backup report” < /tmp/my_report.log echo "----------------------" echo "Done" exit 0


Multitail Logs on Linux

Valic —  November 22, 2010 — Leave a comment

Have you ever having to control more than a single file with your tail -f ?

I will and I just recently found out that you can run the tail command specifying the -f flag several times so you can give the command:

tail -f /var/log/messages -f /var/log/syslog

You’ll get an output like this:

==> messages <== Nov 22 00:43:07 laptop kernel: [ 61.487969] ADDRCONF(NETDEV_UP): eth0: link is not ready

==> syslog <== Nov 22 00:43:31 laptop pulseaudio[1773]: ratelimit.c: 1 events suppressed

==> messages <== Nov 22 00:43:31 laptop pulseaudio[1773]: ratelimit.c: 1 events suppressed

==> syslog <==

Nov 22 00:45:44 laptop ntpd[1118]: kernel time sync status change 6001

In Bash Shell Scripting the variables do not need to  be declared.

However, if the variable is not declared it will only produce an empty string.  When you declare variables you are telling the shell what value the variable contains.  In this example, the variable $var, note that it can be lower case, has a value of “time”.

Each time the variable is called it will have this value.  You can also declare variables with the declare command.



declare var=time

If you had a variable constructed without declaring the value it would look like this:


Or you may call a variable that has no value attached with something like this:

echo $VAR

If the VAR variable has not been declared you just get an empty string.

First create he folder you want to share:

mkdir /mnt/shared_folder
Then open to edit the rc.local file:
nano /etc/rc.local
And add the following line:
  mount -t vboxsf -w -o uid=1000,gid=1000 my_shared_folder /mnt/shared_folder

And the last step: save, quit. Reboot


Just use the following command:

iptables -A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 5 -j REJECT

In this example our connections are limited to 5.