Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I want to say I am a complete newbie but I want a shell script that will execute a command on a specific time for example on 6:45 am

How is this done, a full example would be very useful! Thank you!

share|improve this question

marked as duplicate by Mitch, Radu Rădeanu, Rinzwind, guntbert, karel Nov 7 '13 at 22:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You may have what you want here at how-do-i-set-up-a-cron-job – souravc Nov 7 '13 at 16:41

You want to use cron.

You create schedules within your crontab (crontab -e). The syntax of how to do that can be seen here.

If you wanted to clear /tmp/ at 6:45 AM every day you'd have something like the following in your crontab:

45 6 * * * /bin/rm -rf /tmp/*

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.