1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help on setting up a cron job

Discussion in 'Site & Server Administration' started by xxll_martin_llxx, Dec 12, 2008.

  1. #1
    Hello

    I'm looking into setting up a cron job to back up some folders on my host so they're emailed to me.

    I'm using Wordpress and have just downloaded the WordPress Database Backup plugin which is a great tool to have.

    I've never set up a cron job before.

    I'm looking to to back up the plug ins and themes folders.

    Thank you
     
    xxll_martin_llxx, Dec 12, 2008 IP
  2. Mxhub

    Mxhub Active Member

    Messages:
    474
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Hi Martin,

    Are you using any control panel? eg. cpanel?

    If you are using cpanel, you can setup under "cronjob"
     
    Mxhub, Dec 13, 2008 IP
  3. xxll_martin_llxx

    xxll_martin_llxx Well-Known Member

    Messages:
    127
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Yes, I have cpanel.

    That's what I'm really asking. I don't know how to use it.
     
    xxll_martin_llxx, Dec 14, 2008 IP
  4. atlantisbusiness

    atlantisbusiness Peon

    Messages:
    309
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Open the Standard Cron Manager. You can set a job to run at a specific interval or at a specific times. Creating a cron job requires only three simple steps (see picture below):

    Cron job

    1. Enter your email address where it says: Please enter an email address where the cron output will be sent. Cron will send you a message when the job is executed, so you’ll know if there are any errors.
    2. In the Command to run: field, enter the full path to your script (you may need to check with your host for this).

    If you want to run a php file, the command will begin with php. For example, if you want to run RSS Import to update your Pligg feeds, you’d enter php and the path to your import_feeds.php file.

    On AN Hosting, your path would look something like this:

    php /home/[your username]/public_html/rss/import_feeds.php.

    If you want to run the automatic backup script, which backs up your MySQL database and emails a copy to you (see 8 MySQL Backup Strategies for WordPress Bloggers (And Others), strategy #7), you’d enter /bin/sh (since this is a shell script), and the path to your script.

    On AN Hosting, your path would look something like this:

    /bin/sh /home/[your username]/etc/upstart_cron_backup.sh
    3. Now you need to set the schedule.
    * Set the Minute(s). You can set a short interval here, or minutes of the hour (you can select multiple items in this—and the other— boxes by using the Shift and Command keys). If you don’t care about minutes, leave this set to 0).

    If you want to test things, set this to run Every Five Minutes. This is a good interval for running the script, checking your email for errors, and changing settings before your inbox gets inundated with cron messages.
    * Set the Hour(s). If you’re creating a cron job to run RSS Import, you might want to set this to Every Hour. If you’re setting up a backup script, you might choose an hour in the middle of the night for nightly backups.
    * Set the Day(s). You’ll probably want to leave this set to Every Day, but you can also choose specific days of the month.
    * Set the Weekday(s).
    * Set the Month(s).

    When you’ve set the schedule, your cron job is done. Click the Save Crontab button. If you set it to a short interval for testing, you should have an email with your output within a few minutes. If there’s an error (usually a problem with your path), check your settings.
     
    atlantisbusiness, Jan 22, 2009 IP
    xxll_martin_llxx likes this.
  5. piyushjeswani

    piyushjeswani Active Member

    Messages:
    451
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #5
    I have heard about cron job.
    can someone explain if possible in simpe words what is a cron job.
    would be very thankful to him.
     
    piyushjeswani, Jan 22, 2009 IP
  6. greenghost

    greenghost Well-Known Member

    Messages:
    816
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    130
    #6
    I would like to know more like piyushjeswani...
     
    greenghost, Jan 22, 2009 IP
  7. mooseweb

    mooseweb Banned

    Messages:
    1,154
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #7
    A cron job is simply a script, program, or for lack of words a executable file that you set to run on your server at a specific time.

    Example: You have a status updater that gives information about the latest sports scores for the NFL. You would maybe set up a cron job to update the publicly viewed information, wherever it may be, and you set it up so that it will update every a hour or every minute.

    I hope that was a clear explanation.
     
    mooseweb, Jan 22, 2009 IP
  8. HSH

    HSH Peon

    Messages:
    73
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    http://www.google.com is a MARVELOUS resource. Try typing "definition: cron" in the search box.
    I know is is so much more work to actually have to try to learn this stuff yourself instead of somebody else doing it for you, but it really does pay off...

    And did you know there is a really cool utility called 'man'? If you have your own linux/unix server, try typing "man cron". Man stands for manual and there is a vast amount of information if you really want to learn how to use a unix based system. If you don't have shell access, you can also go to http://www.linuxmanpages.com/ and search for what you need to know there.
     
    HSH, Jan 23, 2009 IP
  9. mooseweb

    mooseweb Banned

    Messages:
    1,154
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You really don't have to get smart here, as smartasses aren't liked/wanted here.

    When someone asks for help, you don't know if they have already looked and not found what they were looking for....
     
    mooseweb, Jan 23, 2009 IP
  10. xxll_martin_llxx

    xxll_martin_llxx Well-Known Member

    Messages:
    127
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    155
    #10
    Many, many thanks atlantisbusiness. That was exactly what I was looking for with regards to the php /home/[your username]/public_html/rss/import_feeds.php part.

    Rep. left. :D
     
    xxll_martin_llxx, Feb 8, 2009 IP
  11. whosthis.ee

    whosthis.ee Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    how do i setup separate cron job for each category in Pligg CMs
     
    whosthis.ee, Mar 16, 2010 IP