April 21, 2010

Scheduling Jobs without Cron: Using at or batch command

Cron is one of the most widely used job schedulers in the *nix systems such as Linux. However one needs to add jobs in the crontab file to schedule the jobs and this is not possible (typically) for users without super user privileges and not having privileges of being added in cron.allow. For such users job scheduling is possible with the help of the batch/at command or (batch command). An example for using the at command to schedule the execution of the file present at /tmp/test.sh is as follows:

For example I am using program that touches a file in a given directory. So I create the /tmp/test.sh file by executing the following commands
#> echo "touch /tmp/abc.text" > /tmp/test.sh
#> chmod +x /tmp/test.sh

To use at, first make sure that the atd deamon is running, which is the daemon that is responsible for scheduling the jobs.

#> ps -ef | grep atd

Now schedule the job test.sh at say 03:00 tomorrow

#> at -f /tmp/test.sh 03:00 tomorrow

The output will be something like

job 1 at 2009-11-05 03:00

The process will execute /tmp/test.sh at the given time. Do a 'man at' for a glimpse of the complex time specifications such as tomorrow, or +3 days, which are possible with the at command. Some of the examples are as follows:

#> at -f /tmp/test.sh 03:00
#> at -f /tmp/test.sh 4pm + 3 days
#> at -f /tmp/test.sh 12:00 july 15

The list of jobs can be viewed using the atq command

#> atq
6 2009-11-05 02:00 a username

5 2009-11-06 04:00 a username

Removing the 5th job from the above queue is simple. Execute

#> atrm 5

#> atq
6 2009-11-05 03:00 a username

Hope this is useful as I was not able to find a simple tutorial for the 'at' command. I guess its difficult to google search 'at' :).

The IPL experience

Watch IPL live on youtube.com/ipl was the paint on the Vayu Vajra bus that brought me from the heart of Bangalore to the flashy Bengaluru International Airport during my recent India visit. Seeing the ad made me happy as I could watch these matches in France. To be frank the last few weekends have been fun as I prefer to watch the matches held on weekends. But given the events of the last few days I might just skip the matches.

The overall experience of viewing matches on youtube was good, however there were a few things that irritated me during these matches. The most irritating was the blimp and the commentary, *** has been at the forefront of technology. Are the commentator and the marketing firm of *** serious. They could have picked another better tag line related to the pace foundation or the bat wielded by Sachin, the Alchemist, for the last couple of decades. The funniest thing was, irrespective of the match, irrespective of the venue, and irrespective of the cameraman, the video clip used by the commentators was always the same. How perfect can a cameraman be, and how perfectly similar can the weather conditions be? in short how can the cameramen at different venues get the same view? I believe there is no blimp and this story in a way confirmed the absence of the blimp.

The second thing was the constant blabbering of *** Kamaal, *** moment of success, *** timeout and all the crap we are bombarded with. Now the saddest thing was that even in the awards ceremony I heard Kumble say, "It is nice to win a *** Kamaal even at this age". Because of my respect towards to the greats such as Sachin, Dada, Dravid, and Kumble, I am censoring my words matching *F*; but at times I cannot control it. Luckily youtube has fewer but highly irritating ads; irritating because the volume suddenly shoots up virtually tearing the eardrums. The most irritating is the one in which a biker jumping from one ship to another to reach an island full of bimbos playing the holy and peace loving game of beach volleyball.

But this IPL gave me a proud moment as the Pune team was bought for about $370 million. Yes $370 million. Now the funny thing is, while mentioning the amount, a good number of the English dailies preferred to use $ and millions as the currency compared to Rs and most importantly the colonial standard of Crores in their website. I know RBI is yet to decide on the symbol of Rupees but why $, why not £, ¥, or €. Also $370 million for Pune? Seriously? Why? Why not $1 billion? How did they come to this magical figure for a city which is famous for its Sawai Gandharva (सवाई गंधर्व) and Natak (नाटक -plays) and NatyaSangeets (नाट्यसंगीत - operas) and most of all the Puneri Patya(पुणेरी पाट्या).

Speaking of Patya, the press has been very busy with the P's lately. Apart from the pictures of Shoiab Malik who refused to use skype and get married to a girl based on his trust on BSNL, the most important news flashed on google news was the true P in IPL. Here are a few P's that I came across.
  1. Paisa or should I say Penny: I guess this needs no introduction. Given the amount of money exchanging hands and most of all the amount spent on motivating Harsha Bhogle to grow, weave, or transplant hair like our ageing film stars.
  2. Politics. Well this blog by Prem Panicker details on all the stories ranging from Dial M for Modi/Mauritius/Money, the perils of a news daily which act like a parrot and not a reporter, and the hair pin bends in the life of Shukla, the potbellied face of Indian journalism. Some newspapers articles are also well written which give a better insight on these issues; the articles I liked are available [here] and [here]. All of this makes me glad that Shashi Tharoor was not selected as UN Security General; just imagine the disgrace - if he was the Security General he would have acted like the pet dog of US for a few meaty bones.
  3. Privileged. One most important point is the split IPL is creating. Most of the teams are based out of towns that have a bigger English speaking base; for example, Bangalore, Mumbai, Pune, and so on. These are representative of the states which are doing well. We do not have a team from the North-East which has produced great footballers like Bhutia but cricket seems to have not reached there. I guess the primary purpose of a cricket board and to sustain a league is to spread cricket to these areas and motivate new talent by giving them steady incomes. Imagine the development IPL can bring to a state of Bihar. Even Jharkhand, the state of our cricket Captain, Dhoni, does not have a team. I guess no one bid for Tatanagar or Jamshedpur and yet we have to bear ads like this.

On the lighter note, it is ads like these had made the past IPL experience really funny while the excessive ads in the current version have made the viewing experience pathetic. The sixes have become *** maximums, the catches *** Kamaal, and wickets *** moment of success. What is remaining is having an ad for single, dot ball, no ball, wide, and third umpire calls for run-outs. In any case I guess it is a matter of time when all of this IPL business converges to something comprehensible and sustainable.

April 18, 2010

Sania's Swayamvar (सानिया का स्वयं‍वर)

This week the tennis star and the poster girl of many Indians decided to get married. Yet, compared to the fake marriages one is being bombarded on reality shows, her marriage or should I say Swayamvara (स्वयं‍वर) was more entertaining than all soap operas put together. In fact, her marriage was more controversial than her short skirts and the fatwas that tried to lengthen them. More-soever, the time she managed to stay in the limelight was definitely much more longer than the time she currently spends on the tennis court.

What worries me most is that this is a celebrity marriage, whose average length can be computed before a complete scan of the page three of any newspaper. And speaking of loyalty this marriage has its foundation in dis-loyalty as both the bride and the groom were respectively engaged and married to someone when they started seeing each other. In fact based on Shoaib's statements, he was seeing two girls; one supposedly fat and the other whom he called thin, beautiful, and the younger sister of the former; is he trying to say he was involved with two sisters...yuck! Based on these incomprehensible statements the funnier thoughts that came to my mind were based on Shoaib Maliks behavior. How stupid can a guy actually be if he thought his first wife was the elder sister of the bride he married over telephone. Then he backtracks and says he is divorcing her because she was fat. Now, couldn't he just fly to India or have the marriage held in a neutral venue like the US or UK; but no he wanted to set an example of being desperate by marrying a supposedly hot girl over phone (Didn't he hear of Skye, it free you dumb ***). Based on all these desperate behaviors of both the bride and the groom, it will take divine intervention to ensure a happy married life for the couple. However, for the sake of peace between them and the countries I have to wish them a happy married life.

Now coming back to Shoaib and the Siddiqui family; I cannot help speculate that all is not well in cricket. Siddiqui being an Indian and based in Saudi was able to get his chubby little girl move around easily in Dubai and according to Shoaib masquerade another girl as his daughter. He also hosted parties for the Pakistan team in India. All of this along with the Dubai connection has got to appear hazy to anyone who has his eyes open. This Dubai connection makes me really scared thanks to videos of Anu Malik and Kumar Sanu singing praises of Dawood; link between Miandad and Dawood; the statements of Hansie Cronje; and all dirty things about Sharjah as a venue for Indo-Pak matches thanks to our honorable MP Azhar and his accomplice Jadeja. Thanks to all these hazy deals, one cannot consider Shoaib to be as Pak (pure and holy) as his chocolaty looks. In fact I find it difficult to believe his innocence given the amount of money, speculated to be Rs 15 crores, he gave of to break his past marriage.

Given all these complexities, the head of PCB would be a fool to have, either a stupid guy who marries of a phone or a potential match fixer given the money exchanging hands, in a team supposed to represent a country; but then the PCB has turned a blind eye to the Miandad controversies. Also I am really scarred as the couple are extremely media savvy. God forbid, but if anything goes wrong in this marriage, then there is a high likelyhood that both of them, and all their stupid fans and the media, will blow the their personal issues out of proportion to create tension between the countries. In fact I would like to stop here rather than increase the incoherence of this post. Since Shoaib likes technology in the crude form, I would like to send a telegram code 25 and 17 for the couple. And for the sake of peace I am hoping to send code 30 in the following years to come.[Here are the telegram codes: Best wishes on your wedding anniversary - 30, May Heaven’s choicest blessings be showered on the young couple - 25, Wish you a happy and prosperous wedded life - 17].