in Education by
I've been experimenting with cronjobs recently and have it setup like so: crontab: SHELL=/bin/sh [email protected] 26 11 * * * wget http://diruser:[email protected]/path/to/file.php Within the php file it runs is a SQL query which at the moment just runs an insert. This works fine and runs the insert but when I look at the email it produces it says this: email: wget http://diruser:[email protected]/path/to/file.php: Command failed with exit status 1 I was just wondering if anyone knows why it would return command failed? It obviously doesn't fail but the email response makes me think I've done something wrong somewhere. Also, is it good practice to put the file the cron is calling inside a password protected directory or is there a better way around it (such as checking that the request ip is that of the server or something). JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Most likely, wget throws an error because it cannot save the result. By default wget will try to store thr result on disk. When running in a cron job, the working directory is (usually) /. You , as a user, probably cannot store a file there. Instead, tell wget to drop the result, or pipe it to /dev/null. Fox example: wget -O - -q http://diruser:[email protected]/path/to/file.php

Related questions

0 votes
    I have a project that was build in Xcode9. Now I am updating it to Xcode10. I am using ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    I am trying to create a "feature branch" from golang. The following code is not working: reader : ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    Upgraded Jenkins to 2.332.1 and a few plugins to try to stay up to date. Now getting the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 3, 2022 in Education by JackTerrance
0 votes
    I'm new to Python and I want to install some packages with pip. But pip install unroll gives me: Command " ... How to solve this? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    Which Command is used to find the status of the Blocks and File-system health?...
asked Aug 5, 2021 in Technology by JackTerrance
0 votes
    What is the docker command that lists the status of all docker containers?...
asked Jun 18, 2021 in Technology by JackTerrance
0 votes
    What is git diff command? How is it different from git status?...
asked Nov 4, 2020 in Technology by JackTerrance
0 votes
    I am using exit(), quit(), os._exit(), sys.exit() to stop script execution, and I am confused which ... use to stop script execution? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    I'm trying to install MySQL for Visual Studio 1.2.8 and Connector/NET 8.0.13 via MySQL Installer ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Which of the following is not a bulk emailing tool? (a) Fairlogic Worldcast (b) 123 Hidden sender (c) ... Need-for-Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    Which of the following is not a bulk emailing tool? (a) Wireshark (b) Sendblaster (c) Direct Sender (d ... Need-for-Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    with the help of _____ option we can save another copy of the picture with the another file name ?a. save as b. open c. new d. exit Select the correct answer from above options...
asked Dec 12, 2021 in Education by JackTerrance
0 votes
    I have a Virtual Treeview (e.g. TVirtualStringTree). The user can select a row but it would be ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    Which of the following draws nothing? (a) geom_blank (b) geom (c) geom_bin2d (d) geom_contour I had been ... Analysis of R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    I have 2 columns in the python dataframe. I want to check each row in my Column A for any value that ... for this particular purpose. Select the correct answer from above options...
asked Jan 9, 2022 in Education by JackTerrance
...