Shell Script Cron Job

Hey All,

I’m sure this would be a real easy one for some of you, but…

I am running Nextcloud on Ubuntu 24 with aaPanel as the host platform. In here I can setup cron jobs, however I am not familiar with setting them up this way and was wondering if there was someone out there that could help me with the syntax that should be placed into the box for “Script Content”.
If I am allowed to upload an image for an example it may help those willing to help me? Please let me know if the image example would be of help.

If it’s standard crontab syntax, you should be able to use what’s in the Admin Manual: Background jobs — Nextcloud latest Administration Manual latest documentation

1 Like

This is my screen and none of what the standard document seems to demonstrate what syntax would be required for this type of setup.

From the looks of that screenshot you can’t really do it directly. You may be able to I guess use the Shell Script option as a wrapper that executes the cron.php file.

1 Like

could you give an example of just what you mean please and thank you?

I think it might also work directly, because in principle the php command can be called from a bash shell. On hosting panels, however, you sometimes need to specify the full path to the php binary, and for that you need to know where the hosting panel has installed it, which is usually not the default location where the package manager of your OS would install it.

I found >> this << in their forums, so I would try it as follows:

:warning: Don’t forget to adjust the paths to the correct PHP version and to the nextcloud installation folder!

/www/server/php/81/bin/php -f /path/to/nextcloud-installation-folder/cron.php

If this doesn’t work, and you can’t figure it out on your own, maybe you should also ask in their forums: https://www.aapanel.com/forum

2 Likes

I have added the syntax and tested on the hosting panel and all comes back correctly, however Nextcloud is still showing the cronjob has not been run. So I will monitor this and come back but I want to thank everyone for their comments especially @bb77 Thank you for your time and your response, its very much appreciated.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.