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

February 27th, 2009 by Andrea Matesi 1009 Views

Yesterday and Today I had a 2-days "Document and Business Process Management" course, so I woke up early in the morning and drove 100Km one-way (in total, I drove 400+ Km in two days for this course).

On Yesterday (full session-day), I returned home at about 10pm, hungry, tired and (remarkably), still able to update my site, with my plan of letting my head "fall on the pillow" at around midnight.

Too bad preparations for the day after kept my head buzzing and running, so I started thinking at the day after, ie. if everything was ready.

At about 1am I came to the conclusion that not everything was ready - my laptop missed an XP VM for the demo (my laptop seems to have a special place for Ubuntu and the course was about a native Windows application).

So I jumped down the bed and turned my laptop on in the middle of the night, I wgetted Sun's xVM Virtualbox bins and installed it while at the same time, I scp-ed my 12Gb, devxpvm1 from my Ubuntu server (through my crappy 100Mbps lan), to my laptop.

The connection was damn slow (scp said something like ~24 minutes to go), it was 1:something am in the morning and I set my alarm to 5.45am. WTF?!

Well, if I'd been lame enough, I would've taken the course without laptop. Luckily, this wasn't the case, since the at command came to my help!

at - execute commands at a later time

at - execute commands at a later time

The at shell command, is a recent re-discovery (I surely used it in the past), it simply allows you to temporarily schedule an imminent task to run once and only.

Upon the next reboot, no trace of previously scheduled tasks.

Too bad I wasn't remembering the right at syntax, so I simply launched the at comand and started typing what I wanted the laptop to do (I just wanted the laptop to shut down automatically after a safe time slice, in order to allow the scp transfer).


sudo at 2.30 (+ root password).

at>stop (whoops - not working!)
at>quit  (too lame - not working!)
at>exit (not working either!)

As you may notice from the above commands, nothing happened - I couldn't remember how to confirm the execution of a scheduled task! (just FYI, I simply wanted the laptop to shut-the-f#-down "halt").

Next, I opened the man page, but nothing (maybe I eventually was too tired to "RTFM" AND "connect-brain-and-understand™").

A fast search pointed me to an unexpected IBM doc, alleging somewhere that CTRL+D was the right key combo to confirm commands.

Unfortunately, after trying the "CTRL+D" key-trick, nothing happened; then I tried CTRL+SHIFT+D and it worked :)

I then finally made it to bed.

When I woke up, I found my laptop correctly halted: too bad that on day-2 of my "Document and Business Process Management" course, my laptop was just dead weight - the demo went through the projector! (ie. not inside course-takers' laptops as in day-1).

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

Senior Professional Network and Computer Systems Engineer during work hours and father when home.

Andrea strives to deliver outstanding customer service and heaps of love towards his family.

In this Ad-sponsored space, Andrea shares his quest for "ultimate" IT knowledge, meticulously brought to you in an easy to read format.

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