‘batch’ broken in Mac OS 10.5 (Leopard) – SOLVED

May 14th, 2008

Give it a try and let me know if you agree… Quick test:
$ batch now
> ls
[control-d]
job 1 at Wed May 14 14:02:27 2008

$ atq
778240 Fri Jan 18 09:03:00 2002

———-

$ batch 17:00
> ls
[control-d]
job 5 at Wed May 14 17:00:00 2008
$ atq
778240 Sat Jul 17 12:39:44 1993

Update: 10.5.3
This doesn’t seem to happen anymore in 10.5.3, but it doesn’t quite seem to work either:

$ at 3:00
> touch /TEST.TEST
job 10 at Sun Jun 1 03:00:00 2008

This was ran at 2:59:30(or so) and as of 3:45:
$ atq
10 Sun Jun 1 03:00:00 2008

Yet, the command did not execute.

Update 9/21/09:

I don’t know how I missed this before, but in the man page for at on OS X, there is the following comment:

Note that at is implemented through the launchd(8) daemon periodically
invoking atrun(8), which is disabled by default.  See atrun(8)
for information about enabling atrun.

Going over to the atrun page shows that you can enable a launch daemon to periodically run queued at and batch jobs. The executiable that does this should be run with root permissions and is located at /usr/libexec/atrun

Jonathan Laliberte Apple, Bugs, Mac OS X

Calculating Actual Hard Disk Space…

December 18th, 2007

If under 1TB in size simply calculate: (Advertised size in GB) * 0.931
Or, to be exact: (Advertised size in GB * 10^9)/1024^3 should do the trick…

Over one TB you can not just assume 1TB = 1,024GB since the advertising calculation is in base 10, and this crazy device in front of you prefers base 2… So:
Over 1TB calculate: (Advertised size in TB) * 0.909
Once again, to be precise: (Advertised size in TB * 10^12)/1024^4.

Jonathan Laliberte Clarifications, Storage

Move All Windows To Your Main Screen…

October 19th, 2007

ApplescriptSo, you’ve got more than one screen? Life is good with all that wonderful screen real estate, then BAM… You end up back with just your main screen, but your applications have left their windows on those other displays, far out of your reach…

Let’s fix that. This little script simply goes and tells all of your applications to get their act together, to move their window’s to the main display.

You’ll need access for assistive devices turned on, which you can do by going in to System Preferences, Universal Access. At the bottom check the box for “Enable access for assistive devices”.

As it is, the script will tell all applications currently running, that if they have a window that is entirely on the main display – to move it to the top left of the screen.

You may have some applications which keep windows off screen on purpose, if you experience any strange behavior with these applications you can exclude them from the applications which get checked by adding their name to the “processesToIgnore” list at the top of the script. There is an example to show how the list should look in the comment right above it. Be sure to use the exact name of the application.

Lastly, if you have more then one display attached when this script is ran it will basically do the same thing, but windows on other screens will not be moved to the main display, only windows outside the range of all current displays.

Jonathan Laliberte Scripts