A simple backup script

6 May 2008 In: Linux, Web2.0

The other day, I wrote this bash script; I thought it would be good to share it with others too, may save someone time or help somebody. I usually use it at the end of day to create a backup of the software package I developed during the day. Just run it with the directory address you’d like to create backup of as input and in a glimpse the backup tar.gz file will be ready at ~/backups/. Later, for more assurance you may upload your backups to an online repository site like box.net or filedropper.com.

The backup.sh script is:

#!/bin/bash          

SRCD=$1
TGTD=~/backups/

BASENAME=$(echo $1|rev|awk -F \/ ‘{print $1}’|rev)
if [ -z $BASENAME]; then
	BASENAME=$(echo $1|rev|awk -F \/ ‘{print $2}’|rev)
fi
OF=$BASENAME-$(date +%Y%m%d).tgz

tar -cZf $TGTD$OF $SRCD

Nothing special, just a simple backup script; Have a good day.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Live
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Slashdot
  • TwitThis
  • E-mail this story to a friend!

Hi, long time no see.

After one month of busy time, last night I found some free time to upgrade Cube’s and Mokaab’s Wordpress and reopen the blogs. To be honest, the reason why I set them down is not because of Wordpress which was out of date, but yet I prefer not to describe it here. Those who are closer to me may know.

Anyway, about the good news, long story short, “we” also launched two child project:

Ok, take care, catch up with you later.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Live
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Slashdot
  • TwitThis
  • E-mail this story to a friend!

Serenity Prayer

16 Mar 2008 In: Daily Life, Other

God! grant me the serenity to accept the things I cannot change, The courage to change the things I can and The wisdom to know the difference.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Live
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Slashdot
  • TwitThis
  • E-mail this story to a friend!

Linguistically Classified

17 Feb 2008 In: Daily Life

First: I was thinking the other day, that I can classify my friends into four groups according to the sentences they use in their daily conversations:

  • Those who start almost every sentence with the word “Actually
  • Those who start almost every sentence by using the word “Basically
  • Those who end up almost every sentence by the word “Already
  • And those who doesn’t follow any habit in speaking or at least I have not discovered their speaking habit yet.

And I, myself fall into the first group

Second: I’m marking undergraduate student lab reports for data structures course; 46 set to be marked and I have still 36 more to go. I guess now I’m passing from the 1st box to the 2nd box according to this fabulous comic:

PhD Comics: Marking Undergraduate Reports

Update: It took me about 15 hours to mark them all and type the results in the forms and print them and.. I was awake last night and now, I’m dying of sleep, but! I have to stay awake! because I have 4 hours lab supervision this morning…

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Live
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Slashdot
  • TwitThis
  • E-mail this story to a friend!

Hello world!

7 Feb 2008 In: Other

Welcome to Cube.

Happy Chinese New Year! It was quite a while that I planed to start my own blog, yeah, and finally today I made that plan. Today is the first day of year according to the Chinese calendar. This year is the rat’s year and I’m a rat too! What a nice coincidence.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Live
  • Reddit
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Slashdot
  • TwitThis
  • E-mail this story to a friend!

About this blog

In this blog (a.k.a Cube) I’m going to freely talk about almost everything I happen to face in my daily life. As I’m in the field of Computer science and IT, my posts are more likely to be about computers, Web2.0, IT and open source applications.
Thank you for visiting and don't forget to subscribe for Cube blog feeds.

Flickr PhotoStream

    Sunset at Singapore Botanical Garden Singapore Marina Bay Vertical Sky Line Buddha Tooth Relic Temple Twitter in Ubuntu Singapore Air Show 2008 - Country Flags Colmar Tropicale - Berjaya Hills Seven on Clouds Batu Caves - Malaysia

Feed

feed

Archives

I Support

Firefox 3
Link to Linux.org
Help end world hunger
Link to the Spread Open Media project
دانلود نرم افزار
Balatarin

Email Subscription

Cube stats

hit counters