Script in cron not executing - cron

I've been trying to make an internet speed monitor (because our internet connection sucks, and I wanted to be able to show to our ISP that they're giving sh*tty service) by following this http://makezine.com/projects/send-ticket-isp-when-your-internet-drops/
SO far I've been only succesfull on making the script itself. When I test the script by typing in ./speedtest-cron.sh in the terminal window it runs perfectly. But when I add it in the crontab like so
40 * * * * ./speedtest-cron.sh
it does nothing. What am I doing wrong here?

Related

cronjob being kill before finish

I create a cronjob for periodically run the executatble compile from python.
20 23 * * * .../TestInno/inno_main >>.../TestInno/Log/Inno_cronlog_`date +\%Y\%m\%d\%H\%M\%S`.log*
the executable consisted of 2 task
update database
sent email notification
When I run the executable in command line, it does perfectly.
however, the cronjob only does task 1 only (from log file)
Since there's few minute pause while connecting to smtp server for sending email. I suspect that the cronjob think the job's done, so kills the task.
Is it right?
If so, how to prevent it?

Redirect console output to a file from crontab

I have a nodeJs program that runs flawlessly when I run there from the console.
But when I start it from crontab it runs about 20 min and then disconnects. (It reads sensors every 10 seconds)
Of course I do not get any error messages on the console, as background programs have no console !!.
I realize they need to be sent to a log file.
But how?
Sincerely Poul Christoffersen

Get 60 json files of 10 MB per file every 10 hours on Azure using Node.js

I am running a node.js application on Azure and I am new to Azure. Currently, I am using the setInterval() to fetch 60 REST API endpoints every 10 hours that give me a JSON file. I am storing these files on the local filesystem. All this works perfectly on my localhost. However how do I achieve this on Azure? I read about the scheduler and while it gets results , it seems to have an 8MB limit on the body if I am not mistaken. What would be the right way to accomplish this using Azure and what is the difference between setInterval() and Azure scheduler.
Take a look at WebJobs.
You cron that thing every 10 hours and you're done.
{
"schedule": "0 0 */10 * * *"
}
You can use Node or you could simply do a curl:
curl.exe -O http://example.com/api/some_json

How to start X application from SSH

I've tried to search this topic in google, but without any signifant results.
I need to start some GUI app from terminal, but I don't care what this app is showing me. In addition, i need to start few instances of this application in diffrent sessions. It's connected with some GUI automated tests, so I know what I want and I'm looking for an answer :).
I think the proper steps should be:
1) Init new X window session 2) Get my new session id 3) export it to env variable (export DISPLAY:13.0) 4) run my app
but I'm stucked at first step. does anybody here had similar problem?
Xvfb is what I was looking for.
Exec a command in virtual x server:
xvfb-run -a -w 10 command

Open MPI, contact information is unknown

I am working on Mac OSX and using bash as my shell. I have been working for the past few hours trying to get the simplest of code to run using Open MPI on multiple computers. After fiddling with configuring Open MPI, I believe I am on the verge of getting the thing to work. However, I have hit a dead end.
The code runs fine without asking other computers over the internet to run it (meaning, I can run it using Open MPI on my own desktop), but when I put in a hostfile and ask a host to run the code I get an error. I think I am connecting to the host fine otherwise, I can ssh to them and do whatever I want, it's just when I run the code.
To produce the following error I run: mpirun -n 4 -hostfile /path/hostfile.txt ./mpi_hello_world. Then it ask for the password on the host I am access, I enter it and then receive the following:
[MyComputer] [[62774,0],0] ORTE_ERROR_LOG: A message is attempting to be sent to
a process whose contact information is unknown in file /opt/local/var/macports/
build/_opt_mports_dports_science_openmpi/openmpi/work/openmpi-1.7.1/orte/mca/rml/
oob/rml_oob_send.c at line 362
[MyComputer] [[62774,0],0] attempted to send to [[62774,0],1]: tag 15
[MyComputer] [[62774,0],0] ORTE_ERROR_LOG: A message is attempting to be sent to
a process whose contact information is unknown in file /opt/local/var/macports/
build/_opt_mports_dports_science_openmpi/openmpi/work/openmpi-1.7.1/orte/mca/
grpcomm/base/grpcomm_base_xcast.c at line 166
Would anyone be able to give me an idea of what is going wrong here? Thanks for any insight you can offer.

Resources