How to run a Symfony command in Windows task scheduler? - symfony

I created a Symfony command that I can now use in cmd. I like it to be run every 15 minutes in my Windows task schedular. I created the task and everything to make it run every 15 minutes, but it doesn't execute the command. What am I doing wrong?

While writing the answer I figured out what I was doing wrong. I belive it is still worth posting since I've seen more people trying to get the question, in general, working but without success.
I had to remove the "" in the field Parameters toevoegen (dutch for "add parameters"). It now looks like this:
EDIT: To answer DavidG it's comment; You can get into this screen by pressing the Windows button and search for task schedular (or Windows Key + R -> taskschd.msc). Create a new folder with the name of your project or whatever. Press right mouse button on the folder and click "create task". If you then go to the actions tab you are where I am in the picture above.
The "Beginnen in" full path is: C:\xampp\htdocs\testExample, where testExample should just be your project directory name, not command or public directory, just the main directory with all of Symfony in it.

Related

Create new project in new session in R

Is there a way to create a new project in a new session?
When I press "New Project" with a project already open, R asks me if I would like to save the workspace image of the current project. It then closes the current project. There is an option for "Open Project in New Session" for pre-existing projects, but I don't see a way of creating a new project.
In RStudio, after selecting New Project from the project pulldown in the upper right corner of the screen, RStudio asks whether to save the current workspace and brings up a New Project dialog box.
After selecting Existing Directory, the next window includes a checkbox to create the project and open it in a new session. If one checks the checkbox, RStudio keeps the previous project open and creates the new project in a second RStudio session.
I've just read the accepted answer (#Len Greski) to this, which shows a feature that I was never aware of despite using RStudio for quite a long time!
If you are using Mac OS, though, I can also propose an alternative, 'one-click' approach, which is what I use and which works very well. There may be similar variants of this that may work on other operating systems (and if so, please feel free to edit them into this reply, or in the comments).
You can open a 'new' instance of 'RStudio' from a shell command-line using:
open -n /path/RStudio
# replace /path/RStudio with the path to your RStudio installation
You can use this to open as many simultaneous RStudio instances as you like, which each run their own R sessions independently.
To make this into a 'one-click' approach, you can 'wrap' the command-line call into an application (which I keep in the Mac OS 'dock'). I used the 'appify' script by Thomas Aylott / Matthias Bynens: see https://gist.github.com/mathiasbynens/674099.
This now sits in my 'dock', and clicking on it will open a new RStudio instance:

How can we redirect 'RobotTempDir' folder to save at different location on windows 10?

I am working with Robot Framework using RED editor on Eclipse IDE. When i ran a Robot test case an error as shown in the screenshot has occurred
Upon tracing back my actions, I have noticed that RobotTempDir... got deleted from Temp folder. I restored that folder and ran the test case. Then it executed successfully.
In future there are chances that while cleaning temp folder contents, RobotTempDir... may get deleted unknowingly. Is there a way to redirect this RobotTempDir... contents to save in a different location?
I looked into the C:\Python36\Lib\site-packages\robot path and didn't find any files where i can change/update Robot temp folder details.
The TestRunnerAgent.py is not part of the Robot Framework application but instead comes with the RED plugin. It is part of their Robot Run functionality which allows it to retrieve information from Robot Framework while it is running.
This information is then displayed in the Eclipse Message Log panel or used when using the RED debugger functionality.
In my view this file is generated every time Eclipse is started and I think the only time this error would occur is when that file/folder is deleted while Eclipse is running. Restarting Eclipse should fix this.
TestRunnerAgent.py is custom listener which is attached to Robot process to report back to RED what is happening during test execution. For normal test runs,this is Execution View information,also Message Log stuff printed there. For Debug run, TestRunnerAgent.py allows to control execution process (breakpoint stop,stepping) and changing internals of Robot (state of variables).
It is embedded in RED package,and as you said, it is temporary placed in Temp dir for execution. If you would like to check source,either check jar file: org.robotframework.ide.core-functions-0.0.1-SNAPSHOT.jar or on GitHub: https://github.com/nokia/RED/tree/master/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts
Back to your issue:
RED starts Robot execution with following command:
<selected python interpreter> -m robot.run --listener <path to TestRunnerAgent.py> <details what to run and other miscs>
There is no indication of error such error in TestRunnerAgent.py although there is in RobotLaunchConfigurationDelegate.java which tries to start Robot using interpreter in current Project configuration. I assume that there is something wrong in your env setup (either in RED or in OS)
I would suggest to check following:
check if you selected proper python interpreter with installed Robot (from Windows->Preferences-> RobotFramework ->Interpreters
check if your project looks similar as here: http://nokia.github.io/RED/help/user_guide/quick_start.html
you can try to use custom script to catch robot execution command and remove --listener part to validate if this is the culprit: http://nokia.github.io/RED/help/user_guide/launching/local_launch_scripting.html
there should be command in Console View - try to run it by yourself

Mouse not clicking the intended image using sikuli library for robot framework on virtual machine (azure)

i am currently running robot tests using sikuli library(for a desktop application) on a virtual machine in azure.
I have problems with mouse not clicking intended image. and i get the error below.
[error] RobotDesktop: checkMousePosition: should be L(209,150)#S(0)[0,0 2049x1152]
but after move is `L(210,150)#S(0)[0,0 2049x1152]`
Possible cause in case you did not touch the mouse while script was running:
Mouse actions are blocked generally or by the frontmost application.
You might try to run the SikuliX stuff as admin.
[log] CLICK on L(209,150)#S(0)[0,0 2049x1152] (562 msec)
Could someone help me how to solve this issue. i tried running the script as an admin and also checked resolution but still doesnt work.
Any help would be appreciated. thanks.
That message is thrown usually because lack of privileges. If you tried running the program vía command line, try to create a new user with Administrative privileges. Later, execute the program with Shift + Left Click --> Run as ... and enter the new credentials. That should work.

Is there any console tool to save some commands as bookmarks or buttons?

I work often with ssh and command line scripts. I would like not to type the name of the command with arguments again and again and also to call my scripts by clicking a button.
Is there any console application that does that?
My guess is that I should fork a console tool (like konsole) and then add buttons that can be associated with commands I want to use often.
Then the better option is creating a desktop launcher , like the following as target.
Assuming you are having a gnome desktop.
Execute the following command,
gnome-desktop-item-edit --create-new ~/Desktop
This will launch a window ,which will prompt for a command name , command ,and comments.
Fill it as per your needs,
Eg: name : MyCommand_to_start_apache
command : httpd -f /my/custom/httpd.conf
That's it , if you want more fun give a try for gnome-panel or gnome-tweak-tool.
Another great tool is AutoKey

Automatic E-mailing of pdf graphical output at specific times from R

I have some scripts I'd like to run each morning at 6am. These scripts produce some pdfs of graphical output into a file: foo.pdf
I'd like my system (let's say Win 7, >= R 2.13) to email me these pdf's once the system has finished running the scripts.
Which is the best package - and most robust way of setting it up - to have these reports emailed to me directly via attachment from R?
Are there any 'cool' extensions to this (like sink() -ing report text output into the body of the email)?
Thanks in advance for any advice.
You can harness the power of a package that can handle emails coupled with a chron job. On Windows 7, I've achieved something akin to this using Windows Task Scheduler. Basically, you set it to run a particular script at a specified time.
I have a script running daily, and had lots of problems to get it to run. Take a look at Roman's link for the attachment and R code first. This is about the non-R part in Windows 7.
I had problems running the R script directly from Windows Task Scheduler, so I scheduled a batch file to run every day as follows:
#echo on
"C:\Rpath\R-2.15.1\bin\i386\Rcmd.exe" BATCH "C:\filepath\filetorun.R"
That's about the simplest you can get, but Quick R was a starting point.
Depending on your computer's settings, you might have to fiddle with the task scheduler. If it's a server type that's always on, then you shouldn't have too many issues (and you know what you're doing). If you have to log off and use a password to login or access a shared drive, you'll have to do some of the following. Also, I don't know if admin rights is a necessity or not.
Open Task Scheduler, make a new task, and open its properties window.
Under General, check the user account and select "Run whether user is logged on or not" and UNcheck "Do not store password." This will allow your script to run if you're logged off (I don't think it works when Locked). When you click Ok, it will ask for your password.
Basic setup: The Trigger is "On a schedule" and Advanced is Enabled. Under Actions, select "Start a program" with the Program/script as the .bat file.
Under Conditions, uncheck "Start the task only if comp is idle" and check "Wake the computer to run this task." Under Settings, check "Allow task to be run on demand," check "If the running task does not end..," and at the bottom, select "Stop the existing instance." These options might be necessary, though I'm not as sure about these.
Another trick is if your company has you switch passwords every once in a while. Open and close the task after changing so that it asks for your password again. Enter the new one or else it can't log in and won't run your script.

Resources