De man 5 crontab
:
An active line in a crontab will be either an environment setting or a cron command.
Ou seja: uma linha não comentada ( #
) poderia ser:
PATH = /bin:/sbin
Que definirá o valor de PATH
para todo o arquivo crontab
.
Se esse valor não for definido, o valor interno (em código) conforme mostrado nesta resposta é usado.
Exemplo de um arquivo crontab definindo o PATH:
SHELL=/bin/bash
MAILTO=root
PATH=~/bin:/usr/bin/:/bin
# Edit this file to introduce tasks to be run by cron.
#.---------------- minute (m) (0 - 59)
#| .------------- hour (h) (0 - 23)
#| | .---------- day of month (dom) (1 - 31)
#| | | .------- month (mon) (1 - 12) OR jan,feb,mar,apr ...
#| | | | .---- day of week (dow) (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# .---- user
#| | | | | |
#* * * * * root echo "the command to be executed"
#
#m h dom mon dow user command
* * * * * root echo "A crontab file test"