Running kickstart.sh as a cronjob



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

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

    and got this as a result when ran:

    /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.


  • Staff

    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.

    https://learn.netdata.cloud/docs/agent/packaging/installer#automatic-updates

    In relation to the cron issue, I think you might need to escape the < with a \ perhaps. https://serverfault.com/a/274480



  • @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



  • @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:

    # 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"
    


  • 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.



  • 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?


  • Staff

    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 🙂


  • Staff

    @chris.pollock,

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

    You can read more about the logs here: https://learn.netdata.cloud/docs/agent/daemon/config


  • Staff

    Thanks @andrewm4894 for the ping and your assistance 🙂



  • @OdysLam Link to the /var/log/netdata/errors.log, do you need the access log also?
    link text


  • Staff

    Hello @chris-pollock ,

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

    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:

    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!



  • @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.

    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.
    

  • Staff

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

    Please, let us know if you need any help.

    Best regards!


Log in to reply