The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need help setting up a cron job

Discussion in 'General Discussion' started by cronjobber, Nov 8, 2011.

  1. cronjobber

    cronjobber Member

    Joined:
    Nov 7, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi there,

    Im new to cpanel, but i have a hoster who uses cpanel, its very nice and easy!!

    I own my own e-business store thrue Joomla+virtuemart.

    My wholeseller has a system wich allows me to import the products thrue a .xls/csv file...

    The wholeseller doesn't have the file stored on a server, but instead has a url wich would be entered into a browser and the browser prompts a file to be downloaded...
    /http://www.nicewatch.nl/makecsv.php?category=566
    As you see this is not a file but a url wich generates a file.

    I need this file to be downloaded automatically on my server, in wich another cronjob makes the joomla component read the file that has been downloaded on the server...

    What would be the right command?

    The file needs to be generated and saved on my server...
    /http://www.nicewatch.nl/makecsv.php?category=566
     
  2. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello Cronjobber,

    You have not mentioned the frequency of the download on your server. However you can set the cron from cPanel itself
    You can also follow the below steps which are mentioned in cPanel User Guide

    Steps
    1 To access the Cron Jobs Menu, click on the icon above the words Cron
    jobs on the main screen of your cPanel interface.
    2 Click on Standard to access the Standard Cron Manager.
    3 Enter the email address you wish the output of the command run by the cron
    job to be sent to in the field next to .... will be sent :
    4 Enter the command you wish the cron job to run in the blank field next to
    Command to run:

    Here you can type

    wget <the url> >> /dev/null

    Put the exact URL in place of <the url>

    5 Select how often you wish the command to be run by selecting an option in
    each of the boxes.
    6 Click on Save Crontab to save your changes and set up your cron job
     
  3. cronjobber

    cronjobber Member

    Joined:
    Nov 7, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner

    HI, thank you for your reply, but this is not actually what i meant...

    I know how to go to cpanel and to the cron option but, i dont know what command i need to use for the function i want.

    And i can see in the cron option how to set the frequency...

    I want it to load 2 times a day...
     
  4. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hi,

    As you are importing products from .csv/xls file downloaded from the URL "http://www.nicewatch.nl/makecsv.php?category=566" wget is the command which you can use to run the cron.

    So correct syntax of the command would be wget "http://www.nicewatch.nl/makecsv.php?category=566" > /dev/null (URL should be without double quotes)
     
  5. cronjobber

    cronjobber Member

    Joined:
    Nov 7, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    The problem in this case is that the output of the file on my server is not the csv/xls file but a file what can not be opened, so i cant import this...

    Is there a possibility that the file can besaved within the rootfolder of my site?
     
  6. cronjobber

    cronjobber Member

    Joined:
    Nov 7, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi thanks again for your reply.

    Unfortunately, this job downloads a file that can't be opened.
    The output xls file is not generated...
    Can i also alter the path where the file would be saved in my root foldeR?
     
  7. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Yes you can make the changes in path to where you want to download the file. I am afraid .xls file can be opened by try some other way.
     
  8. cronjobber

    cronjobber Member

    Joined:
    Nov 7, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    The file that renders from the url turns out to be a html file..
    Is there a way to automatically convert it into a csv or xls?
     
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If the url is used to generate the file but that isn't the end result, then what is the url that you have for the end result? If you aren't getting a different url, then you likely should ask the maker of the program if this is even possible with their software.
     
  10. cronjobber

    cronjobber Member

    Joined:
    Nov 7, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    There is no url with the endresult as the url generates a file, this is the only thing we get..
    The url forces their system to generate a so called .xls file wich is actually a html file...

    I need to convert this to a .xls

    I have found this, could this help?:

    1). I succeeded into downloading the generated file on my server.
    I do need to alter the path to root/feeds/file (or whatever)
    its this url www.mywholeseller.nl/makecsv.php?category=211
    Can you please make a cron command for me that overwrites a file when its downloaded, in the edited path root/feeds/file.xls on 4.am, 8.am, 12. am, 4.pm, 8.pm and 12.pm?

    2). I now need to convert the file (hopefully with this command).
    Then this command needs to convert the output to a xls.

    3). And then i need to import the file... ( i already have a command for this so dont worry.)
     
Loading...

Share This Page