We're all about Linux this week, and reader TheFu reminded us of just how great the Linux command line can be (though it's also in Macs, too). Here's a great primer on using the at command as a simple task scheduling tool.On *nix operating systems, you can easily schedule jobs to be performed later with at. At is like cron, but more flexible for 1-time tasks to be run later.
echo "wget download-some-file-later" | at now + 1 day echo "wget download-some-file-later" | at now + 2 months echo "wget download-some-file-later" | at now + 1 year echo "wget download-some-file-later" | at Friday echo "wget download-some-file-later" | at Tuesday echo "wget download-some-file-later" | at 6/1/11 echo "wget download-some-file-later" | at 5 pm 3/1/11
This command will take whatever the current time is and add 24 hours to it, then it will run the wget command provided. Time specifications are pretty easy to use.
What commands can you use? Anything. Play a song, start an application, send an email, download a file or 1,000. Clean up files, rename files, restart your system. Anything. You can even use "at" to schedule other "at" jobs.
The output will be spooled to your email automatically, assuming your system is setup to send email. On my systems, I setup local account email to be forwarded to my domain automatically in the /etc/aliases file.
Some systems don't allow all users to run _at_ jobs, so check your local settings for at and cron access. You will get an error if you aren't permitted.
Since _at_ works like a job scheduling tool, you can see the queue with atq or remove specific jobs with atrm as needed.
As always, the man pages provide more details
man at man atq man atrm man batch man at.allow man at.deny
If you are on OSX, I suppose this will work too. Sorry, Windows users, MS-Schedule is too cumbersome for these quick uses and more like 'cron' - but still very heavy in comparison.
I use at all the time to clean up temporary files a week later. So if I put a file on a web server for a friend to grab, I email them the link and say the files will be automatically removed in 3 days. Right then, I schedule that removal with _at_ and forget about it.