Skip to content

Instantly share code, notes, and snippets.

@daz
Created August 10, 2011 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daz/1136395 to your computer and use it in GitHub Desktop.
Save daz/1136395 to your computer and use it in GitHub Desktop.
Using Ruby to schedule jobs with UNIX `at` command
time = Time.now + 60
queue_command = <<-CMD
at -t #{time.strftime('%Y%m%d%H%M')} <<-AT
echo "ran at #{time}" > output.txt
CMD
system queue_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment