Posts

Showing posts from August, 2010

Setting Up an NFS Server

  Setting up the Configuration Files There are three main configuration files you will need to edit to set up an NFS server: /etc/exports , /etc/hosts.allow , and /etc/hosts.deny .  In real we need to edit /etc/exports to get NFS to work, but then we would be left with an extremely insecure setup. You may also need to edit your startup scripts. . /etc/exports This file contains a list of entries; each entry indicates a volume that is shared and how it is shared.  An entry in /etc/exports will typically look like this: directory machine1(option11,option12) machine2(option21,option22) directory the directory that you want to share. It may be an entire volume though it need not be. If you share a directory, then all directories under it within the same file system will be shared as well. machine1 and machine2 client machines that will have access to the directory. The machines may be listed by their DNS address or their IP address (e.g., machine....

Commands

Difference between tail -f and tail -F Basically these two command are very similar, except  tail -F  do one more thing: the  retry . This is useful when you are tailing a web server log, e.g. apache log. When the the log file got rotated, the tail -F  will continue to work since it will retry for the rotated file, while  tail -f  can't. Make Backup file cp filename{,.bak} Show disk usage of current dir or selected dir du -s <dir>   Write to stdout echo anything   Write to a file echo anything > <path>    Append to a file echo anything >> <path>    Update the modified time for a file touch <path>    Quickly create an empty file > <path>    Show differences between files diff -r leftDir rightDir    Show files that differ without details diff -r -q leftDir rightDir    Trace execution of a shell...

Crontab

Image
Crontab (CRON TABle)is a program that manipulates the CRON daemon, making it easy for users to schedule task and run programs/commands at pre determined periods of time. Crontab can also be considered a file witch contains commands that will be run by the system as the user that owns the crontab file. What is the purpose of Crontab? Cron is designed to maintain a list of commands that the system needs to run at a given time interval. For example if you have a script that generates statistics and needs to be run every couple of hours or everyday cron can do it for you. Or for example if you have a script that sends a newsletter every month you can use cron to run the script that sends the newsletter every month or week.  crontab -l Lists the current cron jobs crontab -e Edit your current crontab file and ad/remove/edit crontab tasks. crontab -r Remove the crontab file. crontab -v Displays the last time you edited your crontab file. Example on how to set...