≡ Menu

Question: When I perform rsync, it asks for my password on the remote server before starting the transfer. I would like to avoid this, and perform rsync without password. Can you explain with an example on how to setup rsync over ssh without password on Linux?

Answer: The following steps explains how to setup rsync over ssh that doesn’t ask for a password. This is helpful when you are scheduling a cron job for automatic backup using rsync.
[continue reading…]

Many of you asked me this question: I read your articles regularly and learned a lot from them. I would like to thank TGS. How can I help?

The answer is simple: Help me grow the blog by personally recommending it to your friends and colleagues. Send them this welcome url, and request them to subscribe to the blog.
[continue reading…]

12 Bash For Loop Examples for Your Linux Shell Scripting

There are two types of bash for loops available. One using the “in” keyword with list of values, another using the C programming like syntax.

This article is part of our on-going bash tutorial series.

This explains both of the bash for loop methods, and provides 12 different examples on how to use the bash for loop in your shell scripts.
[continue reading…]

Question: How do I execute certain shell script at a specific intervals in Linux using cron job? Provide examples using different time periods.

Answer: Crontab can be used to schedule a job that runs on certain internal. The example here show how to execute a backup.sh shell script using different intervals.
[continue reading…]

Question: I have a php script on my server that can be execute from the command line and also can be accessed from the browser using Apache web server. I would like to execute execute this php script every 1 hour. How do I schedule this as php cron job on Linux environment.

Answer: Use one of the following methods to schedule your php script as linux crontab.
[continue reading…]

SQLite3 is an extremely lightweight SQL database engine that is self-contained and serverless.

There is absolutely no configuration that you need to do to get it working. All you need to do is–install it, and start using it.

Since this is serverless, it is used in lot of the famous software that you are using, and you probably didn’t even know those software were using it. View this list to see all the big name companies who are using SQLite. PHP programming language has SQLite database built in.

If you’ve never used SQLite, follow the steps mentioned in this article to install it on Linux, and create a sample database.
[continue reading…]

If you’ve installed nagios, and using it to monitor remote linux or windows server, you know that you can use the nagios web UI by going to the URL: http://{your-nagios-server-ip}/nagios/

Probably you’ve even defined appropriate nagios contacts, which will send a SMS messages to your cellphone about any critical issues.

At work, when you are always in front of your system, using the nagios checker browser add-on, you can keep an eye on what is going on with your servers and applications, just by looking at the browser status bar, which will display the current status of the servers and services monitored by the Nagios system.

Nagios Checker add-on is available on both firefox and chrome browser as extensions.
[continue reading…]

AWK Vs NAWK Vs GAWK

Awk is a powerful language to manipulate and process text files. It is especially helpful when the lines in a text files are in a record format. i.e A record containing multiple fields separated by a delimiter. Even when the input file is not in a record format, you can still use awk to do some basic file and data processing. You can also write programming logic using awk even when there are no input files that needs to be processed.
[continue reading…]