# Stipple runs in cli but not in cron?

**URL:** https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818
**Category:** General Usage
**Tags:** stipple
**Created:** [August 16, 2022, 11:52am UTC](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818 "2022-08-16T11:52:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![anon69491625](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@anon69491625](https://discourse.julialang.org/u/anon69491625)
#### Post date: [August 16, 2022, 11:52am UTC](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818/1 "2022-08-16T11:52:37Z")

</div>

Hi there  
this is a GENERAL question so I didn’t include any code. I also am aware of julia packages that allow cronlike behavior but I would prefer to keep this simple.

I’m running a stipple julia script to build a web page and it works WONDERFULLY when I run it from the linux mint ( 20.3) terminal. BUT when I put the same script in a cronjob it doesn’t work. There are no log errors from the cronjob. The scripts have printlns in them for debug purposes, I can’t see why that would make a difference. I have made sure that the script call in the cronjob contains the correct path.

```julia
dave@deepthought:~$ julia /home/dave/tontine_2022/2022_live/8_3_22_stpl_pull.jl

```

and the crontab entry

```julia
00 11 * * 2 julia /home/dave/tontine_2022/2022_live/8_3_22_stpl_pull.jl 

```

I run python scripts in the crontab all the time with no issues.

Is there something I am missing between running from cli and cron with regard to stipple or julia?

how could I diagnose this issue please?

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [August 16, 2022, 1:41pm UTC](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818/2 "2022-08-16T13:41:31Z")

</div>

First check:  
give the complete path to the julia executable on your system. You can get it from the shell prompt with:

```julia
which julia

```

In crontab change `julia` to `/complete/path/to/julia`

---

<div class="post-metadata">

### Author: ![anon69491625](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@anon69491625](https://discourse.julialang.org/u/anon69491625)
#### Post date: [August 16, 2022, 7:00pm UTC](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818/3 "2022-08-16T19:00:26Z")

</div>

@oheil thanks for the suggestion. AGAIN I should really have thought of that ☹ I have to wait until tomorrow ( only allowed 1 mess up per day ) to see if the change to the crontab works but the line now is

```julia
00 3 * * 3 /home/dave/.julia/juliaup/bin/julia /home/dave/tontine_2022/2022_live/8_3_22_stpl_pull.jl 

```

Fingers crossed. Thanks again for the help always appreciated.

---

<div class="post-metadata">

### Author: ![anon69491625](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@anon69491625](https://discourse.julialang.org/u/anon69491625)
#### Post date: [August 17, 2022, 10:45am UTC](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818/4 "2022-08-17T10:45:32Z")

</div>

Thank you @oheil , it worked. The full qualification that you suggested did the job

```julia
00 3 * * 3 /home/dave/.julia/juliaup/bin/julia /home/dave/tontine_2022/2022_live/8_3_22_stpl_pull.jl

```

You have made me a happy bunny and, as penance, I’ll spend some time working out why cron doesn’t use the same path as cli. Thanks again for taking the time.  
theakson

---

<div class="post-metadata">

### Author: ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)
#### Post date: [August 17, 2022, 10:51am UTC](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818/5 "2022-08-17T10:51:33Z")

</div>

> [@anon69491625](#):
>
> I’ll spend some time working out why cron doesn’t use the same path as cli

That’s easy to tell:  
crond starts in a different environment, typically stripped down to only basic PATHs and other environment variables. As a user on the system you get the full environment needed for all the things installed on the system.  
Create a cron job which runs just `env > /home/dave/crond_env.out 2>&1` and see what you get in the output file. Compare it to `env` in your shell.

I am happy that you are happy! 😉

---

<div class="post-metadata">

### Author: ![anon69491625](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@anon69491625](https://discourse.julialang.org/u/anon69491625)
#### Post date: [August 17, 2022, 11:22am UTC](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818/6 "2022-08-17T11:22:02Z")

</div>

Hi there @oheil

thanks again for ALL your help. Linux, together with so many other things, is not my strong suit. So I read your explanation ( excellent thanks) and decided to dig a little deeper ( which is what I should have done before bothering you) and found

```julia
man 5 crontab

```

which says

```julia
Several environment variables are set up automatically by the cron(8)
       daemon. SHELL is set to /bin/sh, and LOGNAME and HOME are set from the
       /etc/passwd line of the crontab's owner. PATH is set to
       "/usr/bin:/bin". HOME, SHELL, and PATH may be overridden by settings
       in the crontab; LOGNAME is the user that the job is running from, and
       may not be changed.

```

I KEEP forgetting that crontab is designed for a multiuser environment. Thanks again and I can only hope that someone else will benefit from my ignorance and your kindness.

theakson
