1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to execute commands in webserver?

Discussion in 'Programming' started by Googles76, Jun 10, 2005.

  1. #1
    I am trying to setup the google sitemaps thing and have a few questions. First of all, how can I run this command on my webserver:

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

    Also, does the /path/ need to be changed to the real path where config.xml is located, or does the program assume root folder by itself?

    Thanks.
     
    Googles76, Jun 10, 2005 IP
  2. tflight

    tflight Peon

    Messages:
    617
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You run the script by typing that command into your servers command line interface. So assuming you don't have physical access to the server your website is on you will need to connect to it via telnet or SSH. Note that most hosting companies do not provide command line access to their servers.

    Further, it is a python script to you will need Python installed on your server for it to work. So ask your hosting company if (1) they allow you to connect to the command line (most likely by SSH if they do). And (2) do they have python installed? If the answer to both of those questions is Yes then connect to the command line and run the script by typing it in as you pasted it above.
     
    tflight, Jun 10, 2005 IP
  3. ro_core

    ro_core Peon

    Messages:
    6
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The previous post has information about how to call that function interactively, i.e. from the command line, once, by a human.

    If you want to call this from a php script, see the system() function. This could be useful if you want to regenerate your sitemap every so often.
     
    ro_core, Jun 13, 2005 IP
  4. microtony

    microtony Peon

    Messages:
    281
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    exec() also works well.
    I suggest you to crontab the command.
     
    microtony, Jun 13, 2005 IP