Zen Cart Logo
Forums / General Questions / HOW: Call custom script in admin from cron without logging in to admin

HOW: Call custom script in admin from cron without logging in to admin

Views: 952

Results 1 to 3 of 3
8 Nov 2013, 5:38 PM
#1
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

HOW: Call custom script in admin from cron without logging in to admin

Greetings All,

I have a php script that pulls in a csv file to update our inventory. The script and csv file are in a sub folder under our admin folder. The script includes application_top.php so it has access to the defines and db. All works great once I'm log into admin and manually call the script. However, I need to create a cron job to do this since we will be updating our inventory at regular intervals.

My questions is how can I call the script from cron without having to log into zen admin?

Thanks! :smile:

8 Nov 2013, 6:40 PM
#2
kwright avatar

kwright

Zen Follower

Join Date:
Nov 2004
Posts:
355
Plugin Contributions:
0

Re: HOW: Call custom script in admin from cron without logging in to admin

OK,

I just included configure.php and added my own db connection code since I don't need to use any query_factory.php functions.

However, if someone else has a better idea...that would be appreciated!

Thanks!

9 Nov 2013, 6:09 AM
#3
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: HOW: Call custom script in admin from cron without logging in to admin

Most of the time when I write a custom cron script i will NOT put it in the admin folder, my convention is the cron/ folder but then I'll have it execute using the application top from the includes folder.