Problem with update cron job on GSA 21.4.3

Hi,

I have been struggling with the cron job to regularly update the databases. Followed the hints from Greenbone Vulnerability Manager | Libellux

First, I see a minor problem here:

/usr/local/bin/greenbone-nvt-sync
/usr/local/bin/greenbone-feed-sync --type GVMD_DATA

greenbone-feed-sync is in the sbin folder not in bin.

Second, as the gvm user is nologin, I cannot make the cron job run for them:

0 0 * * * gvm /usr/local/bin/openvas-update

This always gives a /bin/sh not found error. I wonder how to resolve this conflict… (In the previous version I built from source, I did not face such a problem, but I cannot either recall if the description of the cron job or the user type was different.

Thank you

Zsolt

After some experimenting I found that this works fine:
0 0 * * * sudo -u gvm /usr/local/bin/openvas-update

2 Likes

As a reference the cronjob syntax from cron - Wikipedia

<minute> <hour> <day of the month> <month> <day of the week> <command to execute>

This should explain why the following didn’t worked:

0 0 * * * gvm /usr/local/bin/openvas-update

because the cron job had tried to run the gvm /usr/local/bin/openvas-update command and as gvm isn’t a command it failed.

… in which case this snippet in the guide might need an update:
image

Thank you.

Looks like this problem has been already reported to the author of this 3rdparty guide here:

https://github.com/libellux/Libellux-Up-and-Running/issues/99