the "at" linux/UNIX command and related adventures.

February 27th, 2009 by Andrea Matesi 976 Views

Yesterday and Today I had a complex and clever Document and Business Process Management course, so I woke up early in the morning and drove 100Km away (totally I drove 400+ Km in two days for this course).

Yesterday, other than the full session-day, I returned home at about 10:00pm, hungry, tired, and, despite that, still able to update my site and then put my head on the pillow around midnight (just for the case, my new site is - web and open source services and solutions!). Too bad that the combination of my recurring insomnia and the preparations for the day after, kept my head buzzing and running, and so, I started thinking if everything was perfect-ready for the day after, namely today, so, at about 1.00am I came at the conclusion that not everything was fine: my laptop missed an XP VM for the demo (my laptop seems to reserve a special place for Ubuntu and the course was about a native Windows Software). I then jumped down from my bed and powered my laptop up in the middle of the night, I wgetted the Sun xVM Virtualbox bins from their site and installed it; at the same time, I scp-ed my 12Gb, devxpvm1 from my Ubuntu server, through my crappy-limited 100Mbps lan, to my laptop.

The connection was damn slow (scp said something about 24 minutes), it was 1 and something am in the morning and I had pointed my alarm clock to 5.45am. WTF?!

Well, if I would've been lame enough, I would've taken the course without laptop (and related jerk expression...). Hopefully, this wasn't my case, since the at command came in my help!

The at shell command, for me, is a recent re-discovery (I surely used it in the past). It allows you to temporarily schedule an imminent task to run once and only. Next reboot, no trace of previously scheduled tasks. Too bad I wasn't remembering the right at syntax, so I launched it and lamely typed on its prompt what I wanted the laptop to do (well, I just wanted for it to shut down automatically after a safe time slice, in such a way for it to complete the scp transfer).

Basically, I launched:

sudo at 2.30 (+ root password).

at>stop (noob...)
at>quit  (lame...)
at>exit (downgraded-pwrusr-jerk)

...and nothing happened...I wasn't remembering how to confirm my scheduled task! (FYI, I just wanted for it to shut-the-f#-down...err, to halt). So I opened the man page, but nothing (maybe I eventually was too tired to "RTFM" AND "connect-and-understand™").

A fast, random (and nervous), google search, pointed me to an unexpected IBM doc, alleging somewhere that CTRL+D was the right key combo. I said nervous, because at bash linux terminal command ain't easy search!

So, essentially, I found CTRL+D was the key-trick...I pushed down the combination, but nothing happened; I then tried the CTRL+SHIFT+D combo, and it happily worked :)

Then I went to sleep, and finally slept. In the early morning, I found my laptop correctly halted: too bad today my laptop was just a dead-heavy 17" luggage: the demo went through the projector! (and not inside course-takers'  laptops).

Arghh...but let's look at its bright side: I re-learned a way old (and pretty useful) command (and hopefully you too!).

Posted in LINUX, Tips and Tricks. | Comments Off on the "at" linux/UNIX command and related adventures.