Help - Search - Members - Calendar
Full Version: help with wget and mySQL
Linuxhelp > Support > Technical Support
hi smile.gif I have no idea how to work linux and i'm trying to make a cron for my server. I want it to got to a url and download a file there, then to delete the old values in a mySQL table and import the new ones.

The problem I'm having with getting the file is that the url is in this format -

How would I get this to download the file and save it as " wallet.csv " and overwrite the old file?

I have this for clearing the old table and importing the file (I think it's correct but I cant test is since I can get the file yet :/) Does this look like it will work or have I done something wrong?
mysql -h __host__ -u __username__ -p __database__ -e "DELETE * FROM table_name"
mysql -h __host__ -u __username__ -p __database__ -e "LOAD DATA INFILE '/wallet.csv' INTO TABLE wallet FIELDS TERMINATED BY ','";
Check the wget man pages but use the -O option like:
wget -O filename

I do not use mysql so I can not verify your syntax.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.