Hi I test my web on my localhost(winxp+ie8+mysql5.0.51a+PHP 5.2.11+Apache 2.2.13). I want to add some cron job for my php files. I select Pycron. After configuration, I add some command in crontab.txt * * * * * "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://localhost/test/index1.php. It is success, it will open IEXPLORE.EXE and load index1.php for every minute. But it still open the IEXPLORE windows, not for close. how to set it automatic finish the php job, then close the IEXPLORE windows? thanks.
how about using a command-line utility such as Curl or wget: http://gnuwin32.sourceforge.net/packages/wget.htm? Or use Python with urllib/urllib2?
To fire a local PHP event through Pycron, you'll want to do something like this:
First create a new task. Then for the "Command" box in Pycron, enter the location of your PHP.exe file, eg "C:\Program Files (x86)\PHP\v5.3\php.exe"
for the "Parameters" box enter the location of the php file you want to run eg "C:\websites\mysite.com\cron.php"
You don't want to run any of that through Internet Explorer. Fire it directly at the PHP executable. Your server will thank you.
Related
I run my Spring Boot/Batch Jar to process large number of files in my local environment like below:
java -jar /path/to_my_dir_for_jar/springbatch.jar --spring.profiles.active=qa
And logs get generated in the same directory: /path/to_my_dir_for_jar
No issues whatsoever till here.
Now I ran the same job using linux crontab using (11:30 am, daily) :
30 11 * * * java -jar /path/to_my_dir_for_jar/springbatch.jar --spring.profiles.active=qa
Please note: I have to rely on linux crontab to schedule and not spring cron-expression as Spring Batch wont read the new files in the staging directory after first run.
Now I can NOT find my logs at - /path/to_my_dir_for_jar. In the application there different types of logs are generated such as:
service_log.gnxError.log
service_log.gcnDone.log
service_log.error.log
service_log.done.log
service_log.log
I tried to follow this and some other similar help but none of them seem to be working as most of them say - No such file or directory
Where to look for them?
One possible way is to redirect the output of my crontab expression to a file like below:
30 11 * * * java -jar /path/to_my_dir_for_jar/springbatch.jar --spring.profiles.active=qa >> foobar.log
But this way I will loose my different type of logs as everything will be fused in just one file in this case.
Will I get the logs the way I get while running the jar manually ever using linux crontab? What are my options in this situation?
I have a ReactJS-neo4j application, deployed on a cloud server. Currently, i create backups of my databases manually.
Now I want to automate this process. I want to automatically execute the above query every day
Can anyone tell me how to automate the above process ?
You need to change your neo4j configuration file found in <HOME_neo4j>/conf/neo4j.conf as below. The location of the file is different if you are not using Linux server, like Debian.
apoc.export.file.enabled=true
apoc.import.file.use_neo4j_config=false
The 2nd line will enable you to save the json file from default folder "import" to any folder you want.
Then open a terminal (or ssh) that connects to your cloud server. Go to <HOME_neo4j> directory where cypher-shell is installed. Copy and run this one liner script below.
echo "CALL apoc.export.json.all(\"/home/backups/deploymentName/backup_mydeployment.json\", { useTypes: true } )" | bin/cypher-shell -u neo4j -p <awesome_psw> --format plain
This will save the json file in /home/backups/deploymentName just like what you do in your neo4j browser.
I will leave it up to you on 1) how to add the timestamp YYMMDD0000_ in the filename via linux command and 2) schedule the job every midnight via crontab. Goodluck!
I wondering how Azure Webjob works.
If I put any .exe file to D:\home\site\wwwroot\App_Data\jobs\triggered\sample>
with file Settings.job
{
"schedule": "0 */1 * * * *"
}
then that .exe file will be executed every minute? How Azure know which file should trigger? Does he just look for any exe file?
I create 3 .bat file to test.
When kudu executes webjob, it will find the first matching file type (.bat, .exe, .py and so on) according to the naming rules, and run it.
My Test Steps
Create webjob{num}.bat file with below script.
#ECHO OFF
echo Hello World webjob{num}!
I create webjob on portal by upload .bat file. Then drop and paste another two .bat file to the path of webjob1 folder.
I check the log, I found that when kudu executes webjob, it will only run one file. After testing, the first file will be run according to the naming rules.
In Windows 10, I have created a scheduled task using SCHTASKS command to run a node.js file in every 10 minutes using a .bat file. I have used git bash to write that command.
Here is my SCHTASKS command:
schtasks //Create //sc minute //mo 10 //tn "Repeat_10Check" //tr \\runnode.bat
My .bat file is located in root directory i.e. C:\Users\username.
My .bat file's name is runnode.bat
I want to run example.js file which is located in F:\Nodejs\project\subfolder directory, using that .bat file by running the following command:
SCHTASKS //RUN //TN "Repeat_10Check"
Normally in git bash i would write following command to run a node.js file:
cd ../../../F/Nodejs/project/subfolder
node example.js
What should i write in runnode.bat to execute those command using the batch file ?
Assuming the file will always be in that directory you could provide a static reference to it like so
SCHTASK /Create /SC MINUTE /MO 10 /TN “Check Every 10 Minutes” /TR F:\ Nodejs\project\subfolder\runnode.bat
And in the myJsScriptrun.bat you could just have it do node example.js
So what the above does is run the .bat file located in the same directory as example.js - this allows us to use node example.js - every 10 minutes.
If you can’t / don’t want to change the directory of runnode.bat you could just do within the runnode.bat
node F:\Nodejs\project\subfolder\example.js
Now if you are going to run this as user the above is fine.
Although you can specify parameters such as runasadministrator - Using the /RU tag.
I do suggest giving http://www.robvanderwoude.com/schtasksxp.php a read for further research
I am new to CruiseControl and automated build. My problem is that the ccnet service always promt me "unable to execute file TortoiseProc.exe /command ...". My config file looks like this
TortoiseProc.exe /command:update /path:C:\Work\global.ad.lib.objectmanagement /closeonend:1
This command(tortoiseProc....) works well in a CMD window. The Ccnet service is execute with an Admin account. "C:\Program Files\TortoiseSVN\bin" is in the environnement variables and can be executed from anywhere. If i force a build from the Dashboard, it builds perfectly. I have the feeling this is just a simple stupid thing...
Tks
You will need to specify TortoiseProc.exe parameters separately from the executable name, inside "buildArgs" element. Here is the right ccnet.config fragment for your situation:
<exec>
<description>Execute TortoiseProc.exe</description>
<baseDirectory>c:\path\to\tortoiseproc\folder</baseDirectory>
<executable>TortoiseProc.exe</executable>
<buildArgs>/command:update /path:C:\Work\global.ad.lib.objectmanagement /closeonend:1</buildArgs>
</exec>
Also you can create cmd-file with your commands and use exec without parameters, if that would be easier for you.