6

The old gnome-schedule program (which works fine under Raspbian Jessie) has been deprecated in Ubuntu, beginning with Ubuntu 14.04 LTS.

So how do we control cron jobs in Ubuntu 16.04?

3
  • 2
    github.com/alseambusher/crontab-ui might be an option for you
    – Rinzwind
    Aug 2, 2017 at 20:11
  • OK, I got nodejs 8 installed, then used npm to install crontab-ui. But now when I type crontab-ui I get the error: /usr/bin/env: ‘node’: No such file or directory - so I see why you said it "might" be an option
    – SDsolar
    Aug 3, 2017 at 2:08
  • The good news is that it all uninstalled cleanly. Thanks for the tip; too bad it didn't work out.
    – SDsolar
    Aug 3, 2017 at 6:22

2 Answers 2

7

Since there is as of yet no GUI-based cron controller available for Ubuntu 16.04, we must go back to the old-school methods which always work - do it from the command line:

Official Ubuntu documentation: CronHowto

Selected excerpts:

For guidance, you can always use

man crontab

To edit your cron programs use this command:

 crontab -e

From the man page:

Crontab Lines

Each line has five time-and-date fields, followed by a command, followed by a newline character ('\n'). The fields are separated by spaces. The five time-and-date fields cannot contain spaces. The five time-and-date fields are as follows: minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday).

01 04 1 1 1 /usr/bin/somedirectory/somecommand

The above example will run /usr/bin/somedirectory/somecommand at 4:01am on January 1st plus every Monday in January.

An asterisk (*) can be used so that every instance (every hour, every weekday, every month, etc.) of a time period is used.

01 04 * * * /usr/bin/somedirectory/somecommand

The above example will run /usr/bin/somedirectory/somecommand at 4:01am on every day of every month.

Comma-separated values can be used to run more than one instance of a particular command within a time period. Dash-separated values can be used to run a command continuously.

01,31 04,05 1-15 1,6 * /usr/bin/somedirectory/somecommand

The above example will run /usr/bin/somedirectory/somecommand at 01 and 31 past the hours of 4:00am and 5:00am on the 1st through the 15th of every January and June.

The "/usr/bin/somedirectory/somecommand" text in the above examples indicates the task which will be run at the specified times. It is recommended that you use the full path to the desired commands as shown in the above examples. Enter which somecommand in the terminal to find the full path to somecommand. The crontab will begin running as soon as it is properly edited and saved.

You may want to run a script some number of times per time unit. For example if you want to run it every 10 minutes use the following crontab entry (runs on minutes divisible by 10: 0, 10, 20, 30, etc.)

*/10 * * * * /usr/bin/somedirectory/somecommand

which is also equivalent to the more cumbersome

0,10,20,30,40,50 * * * * /usr/bin/somedirectory/somecommand

Cron also offers some special strings, which can be used in place of the five time-and-date fields:

@reboot - Run once, at startup.

@yearly - Run once a year, "0 0 1 1 *".

@annually - (same as @yearly)

@monthly - Run once a month, "0 0 1 * *".

@weekly - Run once a week, "0 0 * * 0".

@daily - Run once a day, "0 0 * * *".

@midnight - (same as @daily)

@hourly - Run once an hour, "0 * * * *".


Note that all cron jobs begin in the user's $HOME directory, so it is advisable to use fully-qualified pathnames both in the cron program and in your scripts.

1
  • btw, you can always use crontab -l to list your cron jobs.
    – SDsolar
    Aug 3, 2017 at 21:50
0

You can't influence the crontab, but there is the Orage Time/Calendar application, usually acitvated in the main menu.

There you can schedule tasks as well.

Double click on the clock, to open the calendar, then double click on a single day.

Select a event, new. Give it a name, here, for example, 'Coffeetime'. Set the time to 11:00.

Now choose tab: Reminder, Application, use: YOUR_PROGRAM_TO_SCHEDULE_HERE Deactivate sound and other unsound options.

Now choose tab: Repetition, Frequency:

  • daily, weekly, monthly, yearly
  • 1 for every (day, for example), 2 for every other day and so on
  • more options are available (interval to pause, i.e.)

I have a German UI, so maybe my translation for the tabs doesn't fit exactly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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