Advertisement

How to Download files using Cron Jobs - cURL

Download files using Cron Jobs - cURL

In this tutorial, I am gonna teach you , how to download files using Cpanel’s Cron Jobs with the help of cULR .
Downloading files to your Server using cURL is pretty easy if you have access to Cron Jobs or SSH Shell.
It saves a lot of time if you use this method to upload files instead of downloading file to your PC and uploading it again to your server.
Suppose you have a slow dialup connection, and you want to install Latest Wordpress to your server, you will need to Download it to your own PC then upload to your Server again, it will be a waste of time, Let me show you an easier way, that will save your time and energy.

Login to your Cpanel or any other hosting control panel which supports Cron Jobs.
Click on Cron Jobs button.
If you are using Cpanel, choose Advanced ( Unix Style ).

Fill in these details for time for Cron Job to run:

*/45 * * * *

(This means that cron jobs will run every 45 minute, by which time, we will have our file downloaded)

And this for Command to run :

/usr/bin/curl -o Wordpress.tar.gz http://wordpress.org/latest.tar.gz

Where “/usr/bin/curl” is path to cURL on your Server, and “-o” is used to convert the data into standard output.
Wordpress.tar.gz” can be any name you want for the downloaded file, you can change it to whatever you want.
And “http://wordpress.org/latest.tar.gz” is the URL to download Latest verison of Wordpress, you dont need to change it.

Now, after everything is set up, take half an hour of Sleep (Save some Energy), and you will receive an email about the output of your Cron Job, It will download the file in your Root directory (Home Directory , means outside the Public_HTML folder) named as “Wordpress.tar.gz” or whatever you named it.
Extract that file using Cpanel, and install Wordpress.

Dont forget to DELETE this cron after it finished the Cron Job, or it will re-download the file again and again, thus wasting your server’s bandwith and might overload the server.

Thats it ! You can use this method to download anything to your Server without wasting your time.



2 responses. Wanna say something?

    Comment #1
  1. ebta
    Posted on Jun 18, 2008 at 05:59:23

    Thanks, really helpful
    I have problem with upload file to my server, then I using your tips, and it’s works..

  2. Comment #2
  3. Bilal Ghouri
    Posted on Jun 18, 2008 at 15:15:52

    Thats why I wrote this tutorial bro :)
    Take advantage of my other tutorials too
    Thanks for trying out my tutorial.

    -Regards,
    Bilal Ghouri

Post a Comment