
- #Gpodder in cron job manual
- #Gpodder in cron job full
# * 9-17 * * 1-5 echo "run every minute during usual business hours" # 0 0 * * * echo "run at midnight, every day" # /usr/bin/dmesg # Mails dmesg output to current user # SHELL=/bin/sh # mail any output to, instead of the current user.
# Instead of the shell from /etc/passwd, always use /bin/sh to run commands
#Gpodder in cron job manual
This makes sure you don’t need to look up the manual page or this blog, when you just quickly need to change something. It might be useful to setup a basic cron file that only contains comments. CRON_TZ: This is used to set the time zones used for the command.By default this is set to the owner of the crontab (the user entering crontab -e).
#Gpodder in cron job full
It can contain either a full email address or an existing user on your system.
MAILTO: The output of any command run by cron will be mailed to this address. The default is whatever /etc/passwd says for the current user. SHELL: This will tell cron to use a certain shell. They are however useful to know about when debugging cron jobs. None of these need to be set, as their defaults are usually sane and will be taken from your system. Configuring Cron itselfīefore we actually create our first cron job, it is good to know that there are some configuration variables to be aware of. If it isn’t, you can simply add the following examples at the beginning or end of your crontab. We will assume that your crontab is empty. Since the crontab is mostly a shell script a # character will indicate the start of a single-line comment. It usually only contains lines which are commented out, rendering them inactive. Now run crontab -e crontab -eĭepending on the system you are using, there might already be a default cron configuration file for your user. export EDITOR=$(which nano)įor the duration of your shell session, nano will be your editor. If you want to make sure that it is used start with the following command. If you have no experience with command line editors nano might be easier to use. In most scenarios that will be vi(m) or nano. You will be presented with the editor currently set in your EDITOR environment variable. To configure your cron jobs (the commands you want to run) in your so-called crontab, run crontab -e. While cron may seem a bit confusing in the beginning, it’s actually very simple to use once you know how it works. They can be run both in a timed manner, but also on bootup. Cron jobs allow you to repeatedly run commands.