I know that the scheduler can be used to create a cron job, but in my case, that job involves accessing a url. Problem is, if I use WGET or a batch file, a window keeps popping up. Any suggestions on how to get passed this?
Create a batch file that does what you want. Let's say it's called doit.bat. Create a file doit.vbs in the same directory. It should have the following contents:
CreateObject("Wscript.Shell").Run """doit.bat""", 0, False
Set the scheduler to run doit.vbs.
Yes, indeed. I'd like to cross link you to a site, where this has been discussed while just pasting.
C:\> at [\\machine] HH:MM[A|P] [/every:day] "command"
Furthermore schtasks might be of help. You might want to use curl within a script. It has a specific "silent" function.
Related
How to add a cron job in a Silex PHP Server?
I would like to do some tasks every midnights without a previous user request. I know we can use middleware functions in order to execute some tasks after and before a Request, but I would like to do without one of them.
I just follow some samples which use ConsoleServiceProvice but, although code doesn't show any error, the execute method is never call. And, it is not a cron task.
So, Is it possible to define a Cron job in Silex 1.x??
Thanks.
If you want manage your crontask withiout crotab from console
you can use this Cron Task MAnager
github.com/MUlt1mate/cron-manager
Simple install with composer
You can define a console command in silex, but you'll need a task scheduler to actually run in when you want. Cron is perfect for this!
If you want it to run every midnight, type crontab -e in a terminal and put this in the file:
0 0 * * * <command you want to run>
For more details on crontab formatting, see man crontab.
This is the simplest way, there are more tips and tricks to using cron, do read up on the subject!
What would be the best way to conditionally run an init.d script on linux based on hostname? I'm working with New Relic and some of the servers simply don't need it installed, but they're all otherwise basic copies of one another. This is Ubuntu.
I've tried (and failed) to put in a host conditional but for the life of me I can't get it working. Threw exits in the top of the file as well as in the start function, but it seems to fire up every time. Without knowing completely how those scripts are fired I'm a little confused on how to alter it to not fire if it server name isn't something like production, etc.
Any guidance would be super helpful.
Put this at the top of the script you would like to disable:
if [ $(hostname) != "goodhost" ]
then
exit
fi
replacing "goodhost" with the actual name of the host where the script is supposed to run.
Does that solve the problem?
I need to run a service program, written in FO for abas-ERP continuous.
I heard about some already existing scripts for calling service programs from the shell. If that is possible I could simply use a cronjob for starting this script.
But I don't know exactly where to find a template for these shell scripts, which conditions have to be complied and if there are any restrictions.
For Example: Is it possible to call several FO-programs successively (this might be important relating to blocking licences)?
You can use edpinfosys.sh and execute infosystem TEXTZEIGEN per cronjob.
You could also use batchlg.sh
batchlg.sh 'FOP-Name' [ -PASSARGS ] [Parameter ...]
I'll explain the task requested from me:
I have two containers in Azure, one called "data" and one called "script". In the "data" container there's a txt file with data, and in the "script" container there's a script file.
Now, I need programatically (with WorkerRole) to execute the script file, with the content of the data file as parameters (Example: a script file that accepts a string 's' and returns to the screen "Hello, 's'", when 's' in the string given, and in the data file there's a string), and save the result of the run into another file which needs to be saved in another container called "result".
How do I do all these? I've already uploaded the files and created the blobs programatically, but I can't seem to understand how to execute the file of how to save its result to another file?
Can I please have some help?
Thanks in advance
Here are the steps in pseudo code:
Retrieve the script from the blob(using DownloadToStream())
Compile the script(I will leave this to you as I have no idea what
format your script is)
Load parameters from blob(same as step 1)
Execute script with those parameters.
If your script's can be written as lambda expressions then this becomes a lot easier as you can turn them into Action's
Edit based on your questiions:
DownloadText() is no longer included in Azure Storage 2.0, you only have access to DownloadToStream(). Even if you are using an older version(say 1.7) I would recommend using DownloadToStream() in the event you ever upgrade in the future. This will prevent having to refactor your code.
In terms of executing your script, depending on what type of script it is(if it is c# code you can use this example: Is it possible to dynamically compile and execute C# code fragments?. If you need to execute a different type of script you would need to run it using Process.Start and you can look at this example: http://www.dotnetperls.com/process-start
I do not have much experience with point number 2 but those are the processes I have heard and seen used.
I'd like to run just a single cucumber feature file on autotest. I'd like the test to be run, report failures, then run again as soon as I save a change to my code base. Anyone know a way to do this?
--Jack
I found a solution myself:
Watchr - https://github.com/mynyml/watchr
It watches whenever you save specified files and runs specified tests at that point. Uses pattern matching.