• In Chat
  • About
  • Contact
  • Browse

    Latest Coding

    Latest Daily

    Latest Health

    Featured Story

Coding 2018

| Begin | File Bank |  Register | Reply | Search | Statistics | Manual |
Local Coding / Local /  
 

Setting up a cron job on my mac

 
Author Admin
Admin


#1 | Posted: 28 Sep 2018 06:39 | Edited by: Admin 
I recently installed Blab chat on my MAMP server (this site - see chat). Seems to work great. There is an issue though with guest names in that all created names are stored in the database. Once created the name cannot be used again until it is removed from the database. There is a cron php file in the script to alter the database at regular intervals to sort this matter out. All I had to do was setup a cron job on my Mac Pro which is running the MAMP server software. How to do this? Step in Terminal ...

On Macs there is a script called 'Terminal' which can be found in the Applications / Utilities folder. These are the steps I took using Terminal to setup my cron job ...

1. crontab -e
2. Pressing i to enter insert mode
3. *2/ * * * * curl /Applications/MAMP/blab/cron.php
4. Pressing esc
5. Typing ZZ (capitols)
6. crontab -l (lowercase L)

1: to setup cron
2. to be able to insert commands
3. my cron job, set to run every 2 mins to check whether it was working or not
4. to escape cron insert
5. to escape cron
6. to check on whether my job is listed

I did try to use wget and an URL, but on checking the wget command it was apparent wget wasn't installed. Curl, on the other hand, did work using a direct path to the cron file instead. Once I could see my cron job was working (by checking the database) I altered my cron job to run once per hour like this ...

1 * * * * curl /Applications/MAMP/blab/cron.php

Seems to be working fine.

Handy website to work out cron intervals ...
https://crontab.guru/
Website Designer

Your Reply Click this icon to move up to the quoted message


 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.

 

 
Coding Powered by Forum Software miniBB ®
Online now: Guests - 1
Members - 0
Max. ever online: 4 [14 Oct 2018 12:43]
Guests - 2 / Members - 2
No Of Posts

  • Latest Daily Post ...

  • Latest Health Post ...

CONTACT

Phone: +01 0775 8107 427

sport4u2018@gmail.com

WEBMASTER

email icon Mark Jones

Latest Story

RANDOM CODING

  • Copyright © 2018 MKJ Brainwaving
↑ TOP