find more information on ext2/3/4 filesystem

2013-09-20 2 min read Linux
English: Ext3 & Ext4 file systems: fsck time v...
English: Ext3 & Ext4 file systems: fsck time vs Inode Count (Photo credit: Wikipedia)

In my previous post on check filesystem regurlarly, I mentioned tune2fs. That tool give quite a lot of information. But just in case, you did not find what you are looking for in the output, then you can get much more information on these partitions with the dumpe2fs command.

Continue reading

Delete all but some directories

2013-08-16 1 min read Bash Fedora Linux

I think, like me, you would have faced a lot of situations, where you wanted to delete all the files or directories in a location, leaving only the required files/directories. So, I have a directory containing lots of files/directories and I want to delete most of them except some 5/10 of them, how to I do it.

I finally wrote a small script to do that. First save list of files that you do not want to delete in file called “listnames” and then execute the below script. This will give you the rm commands that you need to execute. If you want you can execute the rm command from the script, but to be able to review, I just have the commands echoed.

Continue reading

configure firewall – the easy way.

2013-04-24 1 min read Fedora Linux

It is good practice to keep iptables/firewall enabled. But configuring it is difficult, do you agree. Not any more 🙂

Install firewall-config

sudo yum install firewall-config

This will install a GUI application, which you can run with “Firewall” application in the dash or with “firewall-config” in terminal. It is pretty straight forward to use this tool, even if you don’t have much knowledge on Firewall/iptables.

Continue reading

steam on Linux – for Fedora

2013-02-22 1 min read Fedora
The Fedora Project logo
The Fedora Project logo (Photo credit: Wikipedia)

 

I was trying to get steam on linux on my Fedora box. Headed over to steam website, but was astonished to find only Ubuntu client over there.  A little googling presented me with the developer website blog of valvesoftware.com. So, here is the link for you, just in case you are searching for the same:

Continue reading

quick bash script for datewise backup of directory

2012-12-12 1 min read Bash Linux

I was working on something and the data was very critical and needed backup. I wrote a bash script to back up the data every 5 hours with cron and bash script. Thought I will share that with you. Here is the script.

#!/bin/bash - 
#===============================================================================
#
#          FILE:  backup.sh
# 
#         USAGE:  ./backup.sh 
# 
#   DESCRIPTION:  Backup all the current files.
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), amit.agarwal@roamware.com
#       COMPANY: Roamware India Pvt Ltd
#       CREATED: 08/19/2011 02:43:32 PM IST
#      REVISION:  ---
#===============================================================================
backupf=( a b c d) #Here you need to specify the directory you need to backup.
bkupdir="/tmp/backup/$(date +%Y)/$(date +%m)/$(date +%d)" #Here you can change the basedir for the backups
mkdir  -p $bkupdir
sudo tar cvfz $bkupdir/bkup_$(date "+%Y%m%d_%H%M").tgz $backupf[*] #Remove sudo if you do not need it.
echo "Backup created in dir $dir"

And then just add it to cron as “00 */5 * * * /home//bin/backup.sh”. Change the path if it does not match what is given here.

Continue reading
Older posts Newer posts