Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

May 282011
 

Enable cron log in Ubuntu 10.04 (Lucid Lynx)

Answer:

By default, the output from cron goes into the default general system log "/var/log/syslog" in Ubuntu.

If you prefer to have an unique file for cron log, you can edit the file "/etc/rsyslog.d/50-default.conf"

Uncomment the line (Remove the #):

#cron.*

And finally restart the log service

# service rsyslog restart

May 262011
 

Revert the effect of an earlier changeset in Mercurial

Answer:

In Mercurial, if you want to revert the effect of an earlier changeset, even the changes have been pushed to remote, it is still possible with the hg backout command.

1. Find the revision you want to backout using hg log
# hg log

2. Assume you want to backout to the revision 99, then you can
# hg backout -r 99

May 242011
 

Printing the exclamation mark using echo

Answer:

You might observed a problem when you try to print the exclamation mark (!) using the echo command

E.g.

# echo "test!"
-bash: !": event not found

To solve it, you can use single quote instead

# echo 'test!'
test!
May 222011
 

How to perform hot backup for InnoDB?

Answer:

You can buy the official backup tool - "InnoDB Hot Backup" if you have the money. But you can also use the free alternative - the Percona XtraBackup

To download and install, you can refer to their web site: http://www.percona.com/docs/wiki/percona-xtrabackup:installation:binaries

To perform a quick and simple backup, you need:

# sudo xtrabackup --defaults-file=/etc/mysql/my.cnf --backup --target-dir=/tmp/backup --datadir=/var/lib/mysql