/    Sign up×
Community /Pin to ProfileBookmark

Setting up my first cron job

I need to set up a cron job for somebody’s mailing list, and I can only find the scantiest information about how a cron job is created. I only have FTP access. How do I set up a cron job to run every five minutes, or what do I tell the person who owns the server to do?

PS – Yes, the server does support cron. A cron job is already set up in one of the other sites on the server and I just want to replicate it.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiNov 26.2009 — If you only have FTP access I don't see how you could do it. The standard way is to runthe crontab command, usually via SSH:

crontab -e

However, you say you only has FTP access which is no good for running commands on the server. Do you have cPanel or Webmin or something similar? If not you could write a PHP script to do it I guess as long as the system() command is available.
Copy linkTweet thisAlerts:
@boneconeauthorNov 26.2009 — Thanks, I'll check with the server owner and see what they're using.
Copy linkTweet thisAlerts:
@MindzaiNov 26.2009 — Thinking about it you could probably do this via FTP by writing a file to /etc/cron.d containing your cron job. Obviously you need write access to that directory though.

BTW to set a cron job to run every 5 minutes you want something like this:

*/5 * * * * /your/command/to/run

Remember to use the full path to any programs you run though (ie /usr/bin/php instead of php) to avoid frustration.
×

Success!

Help @bonecone spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...