Site5 - Built For Designers & Developers MENU

How do I setup a cron job to run this command?

[2 Grey Star Level]

I’m attempting to set up a simple cron job. I need to execute a URL every thirty minutes, and I’ve set up the cron but I’m getting a “No such file or directory” error.

the url I’m trying to hit is “home/my-username/public_html/wp/pictures/build/”

but when I enter it in the “command” area it gives me the error. Is there some syntax I’m forgetting? I just need the server to execute the code at that url.

Thanks!

Michael

Answer #1

The format of that path “home/my-username/public_html/wp/pictures/build/” is probably not formatted right.

In linux, when you begin an absolute path it needs to begin with a front-slash ( / ).

So I assume you intend to point to a file located in:
– “/home/my-username/public_html/wp/pictures/build/”
and not
– “home/my-username/public_html/wp/pictures/build/”
(also, this path points to a directory and not a file/script)

Without the front-slash at the beginning, the path is seen as relative to whatever directory you’re currently working in.

Answers Answered By: netvip3r [6 Grey Star Level]

Answer #2

Hello,

Remember that when you are working with CRON tasks, that you are scheduling os commands to run. With that in mind, you would need to use a command like “GET” in-order for that to work. You will also need to put the public url in rather then the local path.

Happy Hosting!

Answers Answered By: joliver [476 Blue Star Level]

Answer this Question

You must be Logged In to post an Answer.

Not a member yet? Sign Up Now »

Money Back Guarantees
Click to verify BBB accreditation and to see a BBB report.