Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
> Stuck with a cron job
post Apr 1 2014, 02:53 AM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 3
Joined: 8-January 14
Member No.: 18,617

Hi professionals I hope I am posting in the right forum

I have a file which I run in a cron job to try and import a tab delimited text file into MySQL database. Problem is I am new to Linux and I am fairly stuck so if someone could point my in the right direction that would be great

Here is the .sh file which I am trying to run, it seems to grab the text file ok and connect to the db but then produces errors

#Get price retailers list
/usr/bin/wget -O "/home/oracle765/public_html/feed/getprice.txt" '';

$dbh = mysql -u compareandchoose -p Comparechoose12 -h mydatabase # < /home/oracle765/public_html/feed/getprice.txt

$SQL = "LOAD DATA INFILE '/home/oracle765/public_html/feed/getprice.txt' REPLACE INTO TABLE getpriceretailer FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' (id,name,url,logo,rank,products,List)";


and here is the email error I receive

2014-04-01 00:29:02 (1.14 MB/s) - /home/oracle765/public_html/feed/getprice.txt saved [244130/244130]

/home/oracle765/public_html/scripts/ line 14: =: command not found
/home/oracle765/public_html/scripts/ line 16: =: command not found
/home/oracle765/public_html/scripts/ line 18: syntax error near unexpected token `('
/home/oracle765/public_html/scripts/ line 18: `$dbh->prepare($SQL);'
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 24th March 2018 - 06:10 PM