i have built a CMS website that replies upon the mysql records of a 3rd party. i intend to download the 3rd party records via CSV. i then want to use a Cron job via my command line to update my mysql records
i know how to manually upload to mysql via CSV i.e:
LOAD DATA INFILE 'c:/tmp/discounts_2.csv'INTO TABLE discountsFIELDS TERMINATED BY ',' ENCLOSED BY '"'LINES TERMINATED BY '
'IGNORE 1 ROWS(title,@expired_date,amount)SET expired_date = STR_TO_DATE(@expired_date, '%m/%d/%Y');
however, i am not sure how to go about creating a cron job that will automtically link to the command line and then perform this function.
i guess that what i want is a pointer on how i can go about doing this.
UPDATE @fancyPants asked the question "what do i want the cronJob to do?" the answer is this. i want the cronJob job to access the CSV file (that i have previously downloaded) and then upload all those values from the CSV file to the mysql database
i know the command for doing the CSV conversion to mysql;
LOAD DATA INFILE 'c:/tmp/discounts_2.csv'INTO TABLE discountsFIELDS TERMINATED BY ',' ENCLOSED BY '"'LINES TERMINATED BY ' 'IGNORE 1 ROWS(title,@expired_date,amount)SET expired_date = STR_TO_DATE(@expired_date, '%m/%d/%Y');
i am however stuck at the point of how to do a cron job to my command line and then how to execute the above command once the cron arrives at the command line