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.
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.
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.
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.