crontab

General support questions
Post Reply
stevesdl
Posts: 18
Joined: 2017/09/05 17:11:15

crontab

Post by stevesdl » 2017/09/19 17:55:21

A few questions
I created a new job using cron -e.
My job file is in /usr/local/sbin
Looking at the PATH environment variable the explicit "/../local/... is not in there.

Can I assume that the file will be found via the variable /usr/
or should I edit the crontab file and add that path
or should i just move the job file to /usr/sbin?

Thank you
Steve

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: crontab

Post by TrevorH » 2017/09/19 18:06:39

Put it in crontab with the full path to the executable.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

stevesdl
Posts: 18
Joined: 2017/09/05 17:11:15

Re: crontab

Post by stevesdl » 2017/09/19 18:33:23

Super thanks
Will do.
will see how it works tomorrow morning.
Steve

stevesdl
Posts: 18
Joined: 2017/09/05 17:11:15

Re: crontab

Post by stevesdl » 2017/09/19 18:57:59

Sorry. Maybe I spoke to soon.

So I deleted the job.
Manually edited the crontab file and added the job and made sure the path was in as well.

By doing so the following commands show no cron jobs?
crontab -l
crontab -u %username% -l

also looked in /var/spool/cron and no account name to prove a job?

Did I misunderstand the suggestion?

Thanks
Steve

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: crontab

Post by TrevorH » 2017/09/19 19:19:05

When I said put it in crontab I meant using `crontab -e` and then putting the full path to the executable in the line there like

Code: Select all

* * * * * /usr/local/bin/something
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

stevesdl
Posts: 18
Joined: 2017/09/05 17:11:15

Re: crontab

Post by stevesdl » 2017/09/19 19:24:39

Yup I misunderstood. Its obvious - I am new but learning quickly. :)

Thanks
Steve

Post Reply