Forum

Thread tagged as: Question, Problem, Backup

Scheduled task not running

Hello,

I'm trying to backup the database and assets of a website to a dropbox app. I have succesfully set up the dropbox app, added my acces token and created a bucket.

When I backup the database manually it works and I can see it in my dropbox app.

I have set up a scheduled task to backup the database every 1 hour: https://imgur.com/yER1wuM

That scheduled task is not working.

These are the tasks I did manually: https://imgur.com/Y5p1jod

What could be wrong?

My short diagnostic report:

Health check

 PHP 5.6.32 is up to date
 MySQL 5.5.31 is up to date
 Image processing available
Summary information

Perch Runway: 3.0.11, PHP: 5.6.32, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (3.0.11), assets (3.0.11), categories (3.0.11), perch_blog (5.6.1), perch_events (1.9.5), perch_forms (1.10)
App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_events', 'perch_forms' ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/kndrxwbst/domains/kendrix.website/public_html/lpf/perch
PERCH_CORE: /home/kndrxwbst/domains/kendrix.website/public_html/lpf/perch/core
PERCH_RESFILEPATH: /home/kndrxwbst/domains/kendrix.website/public_html/lpf/perch/resources
Image manipulation: GD
PHP limits: Max upload 64M, Max POST 64M, Memory: 128M, Total max file upload: 64M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: lpf.kendrix.website
DOCUMENT_ROOT: /home/kndrxwbst/domains/kendrix.website/public_html/lpf
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Thanks, Mike

Mike Hendriks

Mike Hendriks 0 points

  • 3 years ago

Hi Mike

Are you running a cron job? You'll need to set that up on your hosting (outside of Perch) if you want any scheduled tasks to trigger.

https://docs.grabaperch.com/perch/getting-started/installing/scheduled-tasks/

Hi Jonathan,

Thanks for responding.

When creating a new cron job in DirectAdmin, do I have to specify a time, or is this value taken from the scheduled task I specified in Perch?

Mike

You need to set a time in both. The cron time will trigger all your scheduled tasks in Perch, so set the cron to run at the shortest of all those tasks. e.g. You might have a tweet refresh every 10 mins, mailchimp every hour, and backup everyday – so you'd set the cron to run every 10 mins.

Jon

Hi Jon,

Yesterday I set up a cron job, here is a screenshot of my DirectAdmin: https://imgur.com/a/oX8eY

It's still not working. Did I miss something?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you checked your server log for errors? Your CLI PHP might log to a different location.

The cron log outputs the following line, every hour: (kndrxwbst) CMD (/usr/local/bin/php /home/kndrxwbst/domains/kendrix.website/public_html/lpf/perch/core/scheduled/run.php r1OAm4Gs0rdcyjI9)

Nothing is showing in Dropbox.

Hi Mike

You might find that you need to call a different path for CLI php as Drew says - it depends on the server. Sometimes the path to the installation (e.g. /usr/local/bin/php ) is different for different versions of php. Your host should be able to tell you this.

Alternatively, have you tried calling the url instead? You can use something like /usr/bin/wget -O /dev/null https://YOURDOMAINHERE/perch/core/scheduled/run.php?secret=r1OAm4Gs0rdcyjI9

"Sometimes the path to the installation (e.g. /usr/local/bin/php ) is different for different versions of php. Your host should be able to tell you this."

In my DirectAdmin '/usr/local/bin/php' is given as an example, so I think that is what I have to use, or could it still be another path that I should use?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you ssh in and try it?