Schedule a Mac to sleep, just one time Is it possible to schedule a Mac to sleep just one time? I know I can set a schedule for it, but I want to have control over it.

So occasionally I'll go to bed but leave a file transferring, and I want the Mac to sleep about an hour from now. So how would I go about doing that, without setting a long-term schedule?
The pmset terminal command should do what you want.  The following will put the computer to sleep at 23:45:00 on December 2, 2014.  The command must be run from an administrator account though:

sudo pmset schedule sleep "12/02/14 23:45:00"


The MM/DD/YY date format cannot be changed; so, if you are used to a different format, use caution.

If you do this on a regular basis, you can write a function and save it to your ~/.profile:

# Schedule sleep in X minutes, use like: sleep-in 60
function sleep-in() {
  local minutes=$1
  local datetime=`date -v+${minutes}M +"%m/%d/%y %H:%M:%S"`
  sudo pmset schedule sleep "$datetime"
}