Jump to content

Help Needed With Google Sitemaps Cron Job


Recommended Posts

Hi - I am using PrestaShop v1.6.1.4 and Google sitemap v3.2.0

 

I have a multistore site with 2 stores

 

I am am able to create a site map for both stores when I generate them from within the module

 

I am able to create a site map for site 2 when I put the command line into a browser

 

I am UNABLE to create a site map for site 1 when I put the command line into a browser. 1_gb_0_sitemap.xml is deleted and file 1_index_sitemap.xml is left in the folder as it was.

 

Neither are created when I run them as 2 cron jobs using:

wget -q -O /dev/null https://www.domain.com/modules/gsitemap/gsitemap-cron.php?token=xxxxx&id_shop=1

wget -q -O /dev/null https://www.domain.com/modules/gsitemap/gsitemap-cron.php?token=xxxxx&id_shop=2

I have used this command successfully for a client with a single site store using a server with a similar set-up

 

I then created this PHP file:

<?php 

$file = '../../crontest.txt';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new person to the file
$current .= time() . "\n";
// Write the contents back to the file
file_put_contents($file, $current);

?>

and ran it with this cron command and it worked as expected:

wget -q -O /dev/null https://www.domain.com/modules/gsitemap/crontest.php

Anybody got any ideas?

Link to comment
Share on other sites

  • 5 years later...
On 2/12/2016 at 2:28 PM, skinnybloke said:

Hi - I am using PrestaShop v1.6.1.4 and Google sitemap v3.2.0

 

I have a multistore site with 2 stores

 

I am am able to create a site map for both stores when I generate them from within the module

 

I am able to create a site map for site 2 when I put the command line into a browser

 

I am UNABLE to create a site map for site 1 when I put the command line into a browser. 1_gb_0_sitemap.xml is deleted and file 1_index_sitemap.xml is left in the folder as it was.

 

Neither are created when I run them as 2 cron jobs using:

wget -q -O /dev/null https://www.domain.com/modules/gsitemap/gsitemap-cron.php?token=xxxxx&id_shop=1

wget -q -O /dev/null https://www.domain.com/modules/gsitemap/gsitemap-cron.php?token=xxxxx&id_shop=2

I have used this command successfully for a client with a single site store using a server with a similar set-up

 

I then created this PHP file:

<?php 

$file = '../../crontest.txt';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new person to the file
$current .= time() . "\n";
// Write the contents back to the file
file_put_contents($file, $current);

?>

and ran it with this cron command and it worked as expected:

wget -q -O /dev/null https://www.domain.com/modules/gsitemap/crontest.php

Anybody got any ideas?

Hello, did you solve this, please? Can you share the solution? Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...