I need help setting up a cron job

cronjobber

Member
Nov 7, 2011
6
0
51
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
 

storminternet

Well-Known Member
Nov 2, 2011
460
0
66
cPanel Access Level
Root Administrator
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
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
 

cronjobber

Member
Nov 7, 2011
6
0
51
cPanel Access Level
Website Owner
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

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...
 

storminternet

Well-Known Member
Nov 2, 2011
460
0
66
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)
 

cronjobber

Member
Nov 7, 2011
6
0
51
cPanel Access Level
Website Owner
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)
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?
 

cronjobber

Member
Nov 7, 2011
6
0
51
cPanel Access Level
Website Owner
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)
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?
 

storminternet

Well-Known Member
Nov 2, 2011
460
0
66
cPanel Access Level
Root Administrator
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?
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.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
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.
 

cronjobber

Member
Nov 7, 2011
6
0
51
cPanel Access Level
Website Owner
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.
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?:

Re: Problem cron job not converting excel files

Can this help?

There is a cron job that helps to convert a file... :S
Can this help?

copy the following cron job script (which will execute ssconvert at 00 min 5.00pm 11th of month / 05 min 5.00pm 11th of month respectivley):
00 17 11 * * ssconvert --import-type=Gnumeric_Excel:excel --export-type=Gnumeric_stf:stf_assistant -O 'sheet="2.3" separator=, format=raw quote=""' /opt/eids_etl/2.3.xls /opt/eids_etl/2_3.csv
05 17 11 * * ssconvert --import-type=Gnumeric_OpenCalc:eek:penoffice --export-type=Gnumeric_stf:stf_assistant -O 'sheet="2.3" separator=, format=raw quote=""' /opt/eids_etl/2.3.ods /opt/eids_etl/2_3_ods.csv
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.)