5

I need to compile gcc45 on my computer and that's a lengthy and resource-intensive process for my computer, so I'd prefer to have it do it while I sleep (at night).

What's the closest thing to:

$ @2300 sudo port install gcc45
Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
simpatico
  • 601
  • 4
  • 9
  • 19

2 Answers2

12

The traditional unix command at is usually used for this purpose. e.g.

echo 'sudo port install gcc45' | at midnight
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Keith
  • 7,828
  • 1
  • 27
  • 29
  • 1
    +1 for at; one problem with any of the 'later' solutions will be if the program (including sudo) requires terminal input. The process will either fail or be stopped on SIGTTIN. Make sure that if you are using sudo, to have the appropriate NOPASSWD tag in the sudoers file. – Arcege Apr 11 '11 at 01:05
0

On a mac:

  1. Wrap the command in an executable script
  2. Create an iCal event @2300 and choose as alarm 'run script'
  3. Leave the computer on and at @2300 the script will execute
Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
simpatico
  • 601
  • 4
  • 9
  • 19