Jump to content

Recommended Posts

Posted

Hi

 

Google released a SiteMap Generator built in Python. But they don't say how to connect to your server to run the script. I uploaded it to my public html folder. But I have no idea how to connect to the server via Command Line to execute the script. Any ideas how to do this?

 

Here's a link to the Google page:

 

google.com/webmasters/sitemaps/docs/en/sitemap-generator.html

 

-Mike

Posted

"Connecting to the server via command line" is what's known as a shell, and shell access is not allowed on TCH servers.

 

You'd need to follow the next suggestion ("Setting up a recurring script") by setting up the script to run as a cron job.

Posted (edited)

Sorry, had 1 more question. I think I get how to setup a cron job in the cpanel. But is there a special directory I need to put the Python script in? Like python or cron dir? Or just my public html folder?

 

Thanks for any advice.

 

 

Mike

 

Edit

 

Here is the command I am supposed to run, if it helps. And I think I'm supposed to replace "path" with the root path to config.xml

 

$ python sitemap_gen.py --config=/path/config.xml

Edited by mdedens
Posted

I don't believe it matters what directory you put the python script in. You could put in your /public_html directory, or even a subdirectory of /public_html.

 

Here is the command I am supposed to run, if it helps. And I think I'm supposed to replace "path" with the root path to config.xml

 

>$ python sitemap_gen.py --config=/path/config.xml

Yes, you need to use an absolute file path to the config.xml file, as well as to the sitemap_gen.py file. Your cron command should look something like this:

>python /home/cpanelName/public_html/sitemap_gen.py --config=/home/cpanelName/public_html/config.xml

...assuming config.xml and sitemap_gen.py are in your /public_html directory. Replace 'cpanelName' with your actual CPanel username.

 

Hope this helps...

  • 1 month later...
Posted

Ah, nevermind. Setting up a cron job through cPanel is the easiest thing. It's late and the A/C in my office is broken... Thanks for reading.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...