Forum

Thread tagged as: Problem, Runway, Backup

Perch Not Backing Up Assets

Hello there.

I've recently set up Perch to do backups to Dropbox. Manually clicking backup while in the Perch admin browser backs up everything just fine, with the exception of my perch assets.

I've read that the process can take several separate backups to get all assets, but I've ran more than 10 and have not seen any assets thrown to dropbox.

Once that problem is solved, I'd like to see how the scheduled task functionality works. Before setting up my own scheduled task on the server, I've attempted to do a php script over the command prompt with my secret and also the URL command with the secret as well, with no results aside from "Status: OK , Result: Nothing to do."

My diagnostic summary is below:

Perch Runway: 2.8.31, PHP: 7.0.7, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: $$$$$$$$$$$$$$$ $, with PDO
Server OS: WINNT, cgi-fcgi
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: /perch
PERCH_PATH: W:\$$$$$$$$$$$\web\perch
PERCH_CORE: W:\$$$$$$$$$$$$$$$$\web\perch\core
PERCH_RESFILEPATH: W:\$$$$$$$$$$$$$\web\perch\resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: W:\$$$$$$$$$$$$\web
HTTP_HOST: $$$$$$$$$$$$

I've marked extraneous information with $.

Please get back to me when you can.

itreg it

itreg it 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Assets are only backed up with the scheduled task. Most sites have hundreds, and it's not feasible to do that all in one go with a browser attached to the request.

If you request a backup manually, Runway will always back up the database. Assets never change, so you only ever get one backup of those, not one every hour, day, week etc.

Thanks for your reply, Drew.

How often would you recommend running a scheduled task?

And would simply setting up a Windows basic scheduled task that runs

php W:\$$$$$$$$$$\web\perch/core/scheduled/run.php mySecret through the command prompt be sufficient?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Frequency depends on how often the site content is changing. As there's minimal cost to running the scheduler if there's no work to be done (typically it's quicker and lighter than generating a normal web page) then I don't see a reason not to run it every few minutes.

I can't give you specific advice about Windows because I have no familiarity with it, but it should be safe to just try and see if it works.

Great. I've set up a scheduled task that runs every 10 minutes. The result noted in the admin tab is still showing "Nothing to do" however.

In the assets tab on Runway I can see none of my images when filtered to Dropbox. Is it possible that perch thinks it has no assets to backup so the command ends there?

Drew McLellan

Drew McLellan 2638 points
Perch Support

The backed up assets won't show up duplicated in the Assets app.

They should be backed up, but you might need to wait a touch longer than the first run. There are three schedules at play:

  1. The backup plan will execute at most every 10 minutes. When it's run, it will only do something if it's been more than 10 minutes since it was last run.

  2. The scheduler is executing the backup plans every 10 minutes.

  3. Based on its options, the backup plan will back up the database every x hours. When the plan runs, if the database is due to be backed up it will do that and then exit. No assets will be backed up in that run.

If you manually run a backup, that will prevent any assets being backed up for the next 10 minutes.

It's a balancing act that prioritises database backups over assets, and tries to back up things efficiently without overburdening the server.

TL;DR - wait a bit.

Thanks again, Drew. I'll let you know how it goes after giving it a while.

I set the task to run once an hour and has ran 3 times now. The scheduled tasks history in the Perch Runway admin still has a status of "OK" and a result of "Nothing to do" even after I've made changes in between the backup times.

The plan under the backup tab has "In Progress" with no message attached to it for each of these entries as well.

Dropbox still does not have a database backup or asset backup of any kind, though the database backup will still function if manually pressing "Backup now", so I do have previous "versions" that are in dropbox, but through the scheduled task it should still be creating its own copies, correct?

I'm not quite sure how to proceed from here.

Drew McLellan

Drew McLellan 2638 points
Perch Support

You should set the scheduled task to run more frequently than once an hour. 10 minutes as you had it before was good.

Should I have any assets in dropbox in the interim? I've been letting the process run every 10 minutes with no luck.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, every 10 minutes you should get I think 5 assets backed up, as long as a a database backup isn't due.

I've been testing here since yesterday and it's running nicely.

I ended up just nuking my existing backups from dropbox and started fresh. That looks to have done the trick for backing up assets every 10 minutes. Thanks for working through that with me.

I have 5 separate websites backups that I'm throwing into one dropbox backups folder. This is by design for now, but all of the assets are thrown into the dynamically created "default" folder. Can I edit that path so each website's assets have their own folder?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That should be the file_path option in your buckets.php for the bucket you're using.

Great. That works perfectly.

Is there a way to trigger a full database backup to dropbox besides just clicking "backup now"? I've tried making a text change to something within perch and see if the scheduled task would throw another backup to dropbox, but it doesn't seem to do so.

So since it doesn't back up the database, it doesn't bother to backup assets for some of my websites. 3 out of the 5 I'm testing are backing up assets every 10 minutes though, so it seems strange when their configurations are identical.

Drew McLellan

Drew McLellan 2638 points
Perch Support

The database schedule is determined in the backup plan - there's a field for that.

So if the plan was running every 10 minutes and backing up the database every hour, it would go:

09:00 - database
09:10 - assets
09:20 - assets
09:30 - assets
09:40 - assets
09:50 - assets
10:00 - database
10:10 - assets
10:20 - assets

and so on.

To get a more frequent test environment I've set the database and assets backup in the plan to be every hour, yet no assets are being backed up for these last 2 sites. The database backs up and shelves the backup in dropbox, but no assets yet. I'm still getting 'nothing to do'.

Any other advice you can offer? Once again I really appreciate you working through all of this.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is your database being backed up by the scheduler or manually?

It is backed up by the scheduler.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are your assets in a local bucket?

Yes, they're located in the perch resources folder on my server.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are there any rows in your perch2_backup_resources table?