# Running kickstart.sh as a cronjob

**URL:** <https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62>\
**Category:** Help\
**Tags:** agent-update, agent\
**Created:** [October 10, 2020, 4:28pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62 "2020-10-10T16:28:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.pollock](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/chris.pollock/32/193_2.png) [@chris.pollock](https://community.netdata.cloud/u/chris.pollock)\
**Post date:** [October 10, 2020, 4:28pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/1 "2020-10-10T16:28:26Z")

</div>

I tried putting this in as cronjob in my Ubuntu 20.04 to update the nightly build

```auto
bash <(curl -Ss https://my-netdata.io/kickstart.sh)

```

and got this as a result when ran:

```auto
/bin/sh: 1: Syntax error: "(" unexpected

```

I’m running the script as root. It works fine when run from the command line. I set my cronjobs up using Webmin but it should not make a difference.

---

<div class="post-metadata">

**Author:** ![Thiago\_Marques\_0](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/thiago_marques_0/32/281_2.png) [@Thiago\_Marques\_0](https://community.netdata.cloud/u/Thiago_Marques_0)\
**Post date:** [October 14, 2020, 8:57pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/2 "2020-10-14T20:57:30Z")

</div>

@chris-pollock we are happy that your problem was fixed! 🙂

Please, let us know if you need any help.

Best regards!

---

<div class="post-metadata">

**Author:** ![chris.pollock](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/chris.pollock/32/193_2.png) [@chris.pollock](https://community.netdata.cloud/u/chris.pollock)\
**Post date:** [October 14, 2020, 3:31pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/3 "2020-10-14T15:31:20Z")

</div>

@Thiago-Marques-0 Thank you for the reply. The update went fine this morning and I had no problems with it loading in my browser.

```auto
2020-10-14 08:08:18: netdata INFO : MAIN : EXIT: removing netdata PID file '/var/run/netdata/netdata.pid'...
2020-10-14 08:08:18: netdata INFO : MAIN : EXIT: all done - netdata is now exiting - bye bye...
2020-10-14 08:08:25: netdata INFO : MAIN : resources control: allowed file descriptors: soft = 1024, max = 524288
2020-10-14 08:08:25: netdata INFO : MAIN : Out-Of-Memory (OOM) score is already set to the wanted value 1000
2020-10-14 08:08:25: netdata INFO : MAIN : Adjusted netdata scheduling policy to idle (5), with priority 0.
2020-10-14 08:08:25: netdata INFO : MAIN : Running with process scheduling policy 'idle'
2020-10-14 08:08:25: netdata INFO : MAIN : netdata started on pid 279171.
2020-10-14 08:08:25: netdata INFO : MAIN : Initializing spawn client.
2020-10-14 08:08:25: netdata INFO : MAIN : Executing /usr/libexec/netdata/plugins.d/system-info.sh
Spawn server is up.

```

---

<div class="post-metadata">

**Author:** ![Thiago\_Marques\_0](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/thiago_marques_0/32/281_2.png) [@Thiago\_Marques\_0](https://community.netdata.cloud/u/Thiago_Marques_0)\
**Post date:** [October 14, 2020, 12:11pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/4 "2020-10-14T12:11:46Z")

</div>

Hello @chris-pollock ,

I observed that according your logs, Netdata was only a restart:

```auto
2020-10-13 08:30:46: netdata INFO : MAIN : EXIT: all done - netdata is now exiting - bye bye...
2020-10-13 08:30:56: netdata INFO : MAIN : resources control: allowed file descriptors: soft = 1024, max = 524288

```

As @andrewm4894 said Netdata update automatically when it is using `nightly` instead `stable`, but the installer only can add the cron task when it is installed as `root`.

If you added the next line direct for cron:

```auto
bash <(curl -Ss https://my-netdata.io/kickstart.sh)

```

it had problems to understand the command and probably you would not have problems if this text was written inside a bash script file, for example, `/usr/bin/my_own_update` and after this you could add this bash script for cron. This script would need to have execution permission.

Best regards!

---

<div class="post-metadata">

**Author:** ![chris.pollock](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/chris.pollock/32/193_2.png) [@chris.pollock](https://community.netdata.cloud/u/chris.pollock)\
**Post date:** [October 13, 2020, 9:21pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/5 "2020-10-13T21:21:37Z")

</div>

@OdysLam Link to the /var/log/netdata/errors.log, do you need the access log also?  
[link text](https://pastebin.com/gBSqLZwv)

---

<div class="post-metadata">

**Author:** ![OdysLam](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/odyslam/32/98_2.png) [@OdysLam](https://community.netdata.cloud/u/OdysLam)\
**Post date:** [October 13, 2020, 5:52pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/6 "2020-10-13T17:52:02Z")

</div>

Thanks @andrewm4894 for the ping and your assistance 🙂

---

<div class="post-metadata">

**Author:** ![OdysLam](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/odyslam/32/98_2.png) [@OdysLam](https://community.netdata.cloud/u/OdysLam)\
**Post date:** [October 13, 2020, 5:51pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/7 "2020-10-13T17:51:49Z")

</div>

@chris.pollock,

Can you please send us your logs, so we can take a better look?

You can read more about the logs here: [Daemon configuration | Learn Netdata](https://learn.netdata.cloud/docs/agent/daemon/config)

---

<div class="post-metadata">

**Author:** ![andrewm4894](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/andrewm4894/32/125_2.png) [@andrewm4894](https://community.netdata.cloud/u/andrewm4894)\
**Post date:** [October 13, 2020, 3:22pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/8 "2020-10-13T15:22:46Z")

</div>

hmmm @OdysLam any idea who might know a bit more on this one? I had a go but am a bit out of my depth 🙂

---

<div class="post-metadata">

**Author:** ![chris.pollock](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/chris.pollock/32/193_2.png) [@chris.pollock](https://community.netdata.cloud/u/chris.pollock)\
**Post date:** [October 13, 2020, 2:22pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/9 "2020-10-13T14:22:31Z")

</div>

Again, after the update I just had to restart Netdata via sudo systemctl restart netdata instead of a reboot. Shouldn’t it restart itself after the update?

---

<div class="post-metadata">

**Author:** ![chris.pollock](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/chris.pollock/32/193_2.png) [@chris.pollock](https://community.netdata.cloud/u/chris.pollock)\
**Post date:** [October 12, 2020, 9:32pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/10 "2020-10-12T21:32:36Z")

</div>

Hmm, looks like it did update itself somewhere around 8:30 CDT this morning, although during that time all the system overview metrics locked up and trying to refresh the link gave me a ‘site not found’ in Firefox. I had to reboot the system in order for it to load again. Other sites worked fine including Webmin.

---

<div class="post-metadata">

**Author:** ![chris.pollock](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/chris.pollock/32/193_2.png) [@chris.pollock](https://community.netdata.cloud/u/chris.pollock)\
**Post date:** [October 12, 2020, 1:35pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/11 "2020-10-12T13:35:41Z")

</div>

@chris-pollock I think I see where my problem is. I shut my browser down before going to bed at night however Netdata appears to be running in the background since I get warnings about inbound packets overnight. Shouldn’t the autoupdate also happen then? Here is my /etc/netdata/.environment file:

```auto
# Created by installer
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
CFLAGS="-O2"
LDFLAGS=""
NETDATA_PREFIX=""
NETDATA_CONFIGURE_OPTIONS=""
NETDATA_ADDED_TO_GROUPS=" adm proxy"
INSTALL_UID="0"
NETDATA_GROUP="netdata"
REINSTALL_OPTIONS="--auto-update "
RELEASE_CHANNEL="nightly"
IS_NETDATA_STATIC_BINARY="no"
NETDATA_LIB_DIR="/var/lib/netdata"

```

---

<div class="post-metadata">

**Author:** ![chris.pollock](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/chris.pollock/32/193_2.png) [@chris.pollock](https://community.netdata.cloud/u/chris.pollock)\
**Post date:** [October 11, 2020, 9:57pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/12 "2020-10-11T21:57:56Z")

</div>

@andrewm4894 I have automatic updates enabled, ie…I did not use the --no-updates when installing Netdata. I’ll see what happens if I leave tonight’s update alone and check in the morning.  
Chris

---

<div class="post-metadata">

**Author:** ![andrewm4894](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/andrewm4894/32/125_2.png) [@andrewm4894](https://community.netdata.cloud/u/andrewm4894)\
**Post date:** [October 11, 2020, 9:36pm UTC](https://community.netdata.cloud/t/running-kickstart-sh-as-a-cronjob/62/13 "2020-10-11T21:36:08Z")

</div>

My understanding is that you shouldn’t really need a cron job like this as netdata will update itself automatically to the latest nightly builds.

> **[Installation guide | Learn Netdata](https://learn.netdata.cloud/docs/agent/packaging/installer#automatic-updates)**
>
> Netdata is a monitoring agent designed to run on all your systems: physical and virtual servers, containers, even

In relation to the cron issue, I think you might need to escape the \< with a \ perhaps. [escaping double quotes and percent signs (%) in cron - Server Fault](https://serverfault.com/a/274480)
