This Help forum is for issues relates to the latest release (1.7.2). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

TOPIC: Exporting GEDCOM with cron-job?

Exporting GEDCOM with cron-job? 3 years 6 months ago #1

  • HonkXL
  • HonkXL's Avatar
  • Offline
  • Junior
  • Posts: 148
Is it possible to create a GEDCOM file on the server by command line or cron job? I have some tools that requieres a GEDCOM file. And I would be able to do some jobs automatically if I had a GEDCOM file created automatically. So a php or something else that creates a GEDCOM and stores this somewhere on the webserver would be very helpful.
Is this possible?

Sorry that I asked so many questions in the last weeks. But at moment I have time to use webtrees ;-)
My homepage: www.weiland24.de
My webtrees: webtrees.weiland24.de
The administrator has disabled public write access.

Exporting GEDCOM with cron-job? 3 years 6 months ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 11224
Here's a command-line script that will export all your trees.
<?php
define('WT_SCRIPT_NAME', 'test.php');
// Pretend to be USER #1, with a real browser
$_SESSION['wt_user'] = 1;
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0';
require 'includes/session.php';
foreach (\Fisharebest\webtrees\Tree::getAll() as $tree) {
        $stream = fopen($tree->getName() . '.GED', 'w');
        $tree->exportGedcom($stream);
        fclose($stream);
}

You'll need to sort out access control yourself.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Powered by Kunena Forum