Cron jobs with GUI
Whenever I try to explain using cron to schedule jobs, new Linux users cringe at the thought of touching yet another command line tool. It's a shame, as cron is an incredibly handy tool worth learning and using. Yet, just because you fear the command line, doesn't mean you don't get to take advantage of cron.
With the help of a user-friendly GUI, you can have shcedule automatic jobs with cron.
The tool I'm talking about is GNOME Schedule. The tool let's you create one-time, recurring, or cron jobs from templates.
If you are not that afraid of command line, you can install GNOME Schedule with simple command (assuming you're using Debian):
sudo apt-get update && sudo apt-get install gnome-schedule
However, if you prefer to use GUI software manager, open the manager shipped with your distro. (For Debian-falvoured distros that would be Synaptic, ArchLinuxers have a wider choice, Fedorians have GNOME yum, OpenSusers YaST2 - you know your distribution)
Within the package manager search for
gnome-shedule, mark it for installation, apply, accept any dependencies that might be necessary for installation and there you are - GNOME Schedule is installed on your system.
The usage of GNOME Schedule is simple. Let's walk through the steps for creating a recurring cron job.
First, click the new drop-down (downward pointing arrow associated with the New button) and select Recurrent Task.
In the resulting window fill out all of the information necessary to create the job: description (a name for the job), command (the command you want to run as the recurring task), behaviour (do you want to suppress command output, is this an X Application, etc.), basic (is this task to run every minute, hour, day, week, or month), advanced (schedule the job for a specific time).
After creating the event, click the Add button and the job will be scheduled.
If you look at the bottom of the scheduled task window, you will notice the Add as Template button. You can add this job as a template if it is a job you can easily base other jobs on. If you create template jobs, you can then create a new job based on that template, by click the New drop-down and selecting From Template.
Now, if you want to create cron jobs that need root (or sudo) permissions, you will need to run the tool like so:
- Open a terminal window.
- Issue the command
sudo gnome-schedule(if you are using a non-sudo distribution, su to the root user and issue the command
- Schedule the job as described above.
You will notice, when running in super user mode, you have an extra button - the change user button. This will allow you to schedule a cron job for any user on the system (so long as they have the ability to schedule jobs.)
Gnome Schedule is a very easy way to allow new users to take advantage of the powerful cron tool, without having to learn the command line version. I recommend learning the command line for cron, but for those who don't have the time or inclination, this is a good route to take.