Back in November we released a free cron service for windows
What is it?
It is a task scheduler that uses the same format as the unix cron service.
The motivation for this tool was that the task scheduler built into windows did not have a good way of moving jobs from one computer to another.
With our cron service, you can setup your list of jobs and easily copy the ‘crontab’ file to other servers – the cron service instantly sees the change. No messing around in the registry.
A few problems with 1.0:
-It did not recognize vbs or bat files, so you would have to go through all kinds of trouble to get the command line right
-The logging was not very good, so it was hard to see if a job failed
-All processes executed in the service context. That means you can never run a visual application, and your scripts cannot access network drives.
-No easy way to edit the file – Just notepad.exe. Why not have a nice job editing tool?
With 2.0 we fixed that and more
The first thing we did was add a bunch of execution options. With your job you can:
-Run the job in all active remote desktop sessions
-Run the job in the console session
-Run the job as the current user, or as an administrator
-Run the job in the console, even if no one is logged on. Like this:
Why would you need that?
Think of all the scripts you wish you could run that either need to at least show one small progress window…or access a network drive – even if a user was logged off.
Now with IntelliAdmin Cron 2.0 you can do it.
I bet you are thinking:
“Man that would be cool if remote execute in Network Administrator could do that.”
Yea, we thought so too. All of these options will be added to the Remote Execute action of Network Administrator in a few weeks – Buy it now and it will be a free update.
Included with this version is a crontab edit application. It makes it a breeze to edit your jobs:
If you forget the crontab format, it has a cheat sheet included…so you don’t have to browse around trying to figure it out:
The new service uses log rotation, so the log files will never threaten to take up too much disk space:
Status.log – List of the latest job runs and the result
Error.log – Any errors encountered are reported here
The service watches the crontab file, so all changes are immediate.
If you want to create the crontab file manually, you can find more about it here
We have made a change to the format (It will accept the old format too) to accommodate our execution options.
A typical line in your crontab will look like this:
* * * * * "c:\temp\test.vbs"
The new format has an integer value right before the path of the program to execute:
* * * * * 121 "c:\temp\test.vbs"
Here are the execution options that make up that value:
1 = The process is executed as an administrator
2 = The process is executed as the session user
4 = The process is hidden when executed
8 = The process is executed in the console session
16 = The process will only be executed if someone is logged into the console
32 = The process will be executed in all RDP sessions.
64 = The will disable the job
If you wanted the program to run as administrator in all the current RDP sessions you would use: 33
This is calculated by adding the options together…32+1
If you wanted the program to run in the console as the current user, but only if someone was logged in, it would be: 2 + 16 + 8 = 26
Finally, we made this app as tight as possible. The service app is a little under 150K. If you want to install it without our setup, just copy the icronsvr.exe to the folder you want it in, and install it like this from the command line:
icronsvr.exe install icronsvr
The second argument is the service name..don’t forget to include that.
If you want to remove it use this:
icronsvr.exe uninstall icronsvr
The crontab edit tool just needs to be run in the same folder as the crontab file, but is not required for its operation.
Finally, this is totally free for commercial and personal use.
Click here to get it now from our download page.
Enjoy the IntelliAdmin software goodnees – and as always no spyware or badware.
One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools
{ 50 comments… read them below or add one }
Thank you! Thank you! Thank you!
This is exactly what I was looking for. When you posted the message that there was going to be an update, I never expected all of this. This is perfect for what I am trying to accomplish with your cron app!
Hey Steve. Know I am a pain in the ass. Does this work for 2000?
Yes it does…but it does have some limits. I believe that the process launched cannot map network drives under 2000 due to some limitations with the process creation APIs on that platform.
What about Vista, Windows 7. If you set it to execute as the current user, and the current user is an admin. Will it run elevated?
Yes. Just like the Widows Scheduler it will automatically elevate the process without UAC prompting you.
Well, this is so much win!!! Thank you Steve, this is all i needed!! You guys are just great!!
As I said, this is awesome, but i wan to ask you a thing. Is it possible to include a option to search the crontab file in another location?
Thank you and continue with the great work!
That will have to be in 2.1 🙂
Hello! This looks to be a great program! I’ve found an issue though, jobs added by your GUI have all spaces removed in the path and the arguments fields when written to the crontab file, and if the Full Path field was entered manually with quotes (“), then double quotes are entered in crontab.
Thanks again!
Hello again! (Please don’t post this comment if you don’t want to, but I’m not sure how else to contact you).
I’ve manually corrected the space issue in the crontab file by editing it with Notepad, but the job is failing. I’m suspecting that even though the entry in crontab is correct, when the job is executed by icontsvr the spaces are again being removed.
Thanks!
Sounds like a bug. I will have the team take a look at this right away.
Thanks,
Steve
Hello Keith,
One question..could you send me an example command line that you are using?
send it to: support@intelliadmin.com
Thanks,
Steve
OK Keith,
Thank you so much for reporting this. Our code that was checking the sanity of the hours, min, days, etc…was being used against the filename and the arguments.
We have fixed the issue and uploaded a new version. Here is the download link:
http://www.intelliadmin.com/iadmincron.exe
After the install, go into the settings app and check to make sure it now shows a build number. The build should be 2.1.0.17
Hi,
how add php file on localhost serv.
i try
C:\xampp\htdocs\file.php
http://localhost/file.php
Hello,
The process execution system in Windows will not know where to find PHP.exe so you need to make your filename:
C:\Program Files\PHP.exe
and then your Arguments
c:\xampp\htdocs\file.php
I would test it at the command line first to see if your script is running properly…since php works differently when run this way.
Hi,
Do you have a list of the meaning of error codes from the status log?
I am getting Return Code: 1314
I am testing a simple script on WinXPP to backup data (while logged off) to a Windows network share. Using UNC and IP address for destinatation. Works fine when logged on. Nada when logged off.
Would you mind pointing me in the right direction?
thanks
1314 Is a type of access denied message. I believe that since you are running from the system account when logged off…some versions of windows will not allow access to network shares.
Those return codes are from windows…here is the listing that includes 1314:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms681385(v=vs.85).aspx
I think the only way around this is to have our cron service allow you to specify user accounts…but I don’t know if we will implement this…since there are many security implications. It would require that we store the username and password in a file, and make sure it is encrypted.
Hi Steve,
Thanks for the quick response!
After further testing it appears the destination network share is not accessible. The script runs fine (when logged off) if destination is local.
I am looking for someway of running the backup script using a domain account to backup to a network location.
Will fiddle with it a bit more, but it may not be possible.
Thanks for a cool little product!
Michael
Can you explain the Return codes a bit please. I’m seeing a RC = 1 and don’t know what that means, but it doesn’t look like my script (.py) ran because I don’t see the changes I see when I run it normally.
My cron job has two parts after the timing info: C:\Python32\python.exe then a space then –full path–\script.py
I’m on Win 7
Thanks
That means success. What does your python script do?
That might help us understand why it is failing.
Thanks,
Steve
It’s working now, again with a RC = 1. It was failing because the path in the argument had a space. I put the argument in double quotes and that solved it. Thanks.
Love this product !
Great to hear it. Please let us know if you have any more issues – we are happy to help 😉
IT runs a few queries on one table, makes decisions based on business rules and then and inserts some entries in another table. It’s broadcasting and the overall function is to append to a playlist.
I see what was happing…it was still returning a 1 since python was executing…but it could not see the full path to your script…so now that you have the quotes it can see the whole path…and still returns a 1 since it is still successfully executing python itself.
Hello,
It would be nice if we could execute a certain command under a certain user. Because I am planning to do an automatised backup of a remote fileserver with your programm (which is very good for free), but sometimes there is no session which are opened on the computer, so the batch blocks when it wants to map the network drives. I can use psexec (psexec -u user -p password -i “c:\batch.cmd”) which runs my batch under a certain user which has saved credentials, but it would be good if cron can do it natively (with user/pass encrypted if possible), because i have to give my credentials unencrypted in order to use psexec. If it’s too hard to implement because of security, i will understand. Thanks in advance 🙂
Hi Simon,
It is not really that hard…but our concern would be that some users would not realize the security implications. We could not truly encrypt the file since that would require a password…where would the password go? Probably right back in that same file!
One way around this would be if we could launch a process using only the username…without a password. This hack was possible prior to Vista using undocumented API calls…but we have not found a way to do it in Vista or higher.
Still I think what we could do is simply obfuscate it (This would be encrypt the password using some type of info that is static within the cron app)…the password would be reversible…but it would take much more effort than if it were clear text. And you could secure it by setting windows permissions on the file.
We will keep this in mind for the next release. Thanks for taking the time to comment.
Steve
No trouble, if I can help by leaving feedbacks and suggestions 🙂
Hi! Great Work!
But after update to IntelliAdminCron v2 the configuration file is left, where you can set the path to the crontab file?
We need this very urgently…
Best regards
Nils
Love it so far, but is there any chance that you could add the pid of the process kicked off, as well as when the process is termed to the logs?
Great job, Steve.
I’m using the original version.
Backs up my data drives on a specified day each month.
Perfect.
Thanks so much for all your time.
This gadget is very useful. I want to know, the same dispatch, the first execution is not over, and the second began, this case is how to deal with? In other words, how to make the task can be the implementation of the serial, rather thanparallel execution?
Hello Relinson,
I am not exactly sure what you are looking for, but why not put your list of things to execute in a batch file so they go in order, and then call that bat file from the cron?
Hi !
How to i use parameter of URL same as http://localhost/sptkeyboot/index.php/bot_run_google/test_runcrob ( use CodeIgniter ) when i add a new tab? What is My Arguments ?
Thank you very much.
Hi Dong,
Not exactly sure what you are trying to do. Do you want cron to hit that web page on the specified interval?
If so, you will need to install something like wget, or curl and then have cron call it with your website as an argument
How to use curl in Windows Cron Service? if it can then you give me example. Thanks
Hi! Very useful app!
My question is about logging (Status and Error log file size). Do you plan to add more control over this functionality? What do you mean by “log rotation”? And is it possible to at least turn of logging?
All the best to you and the team, and thanks!
Hello Dragan,
We are always making updates to this app..so anything is possible. It just depends on demand. Log rotation is when the log gets to a specific size, and stops growing…it then overwrites the oldest log entries.
We are brainstorming some more updates for this freebie…so I will put your request on the list.
Thanks,
Steve
Hey Steve,
Great Job!
Is it possible to add a sub-crontable for each specific application?
I am running a dev environment here and it will be great if I could have a specific crontab file for each application not to make one application is messing with another.
Many thanks for Your help,
Krzysztof
The second question is – can I put a crontab file (or each of the sub-crontab files) in a specific location?
Cheers,
Krzysztof
Hi, steve,
This App is awsome. Thank you.
When I use mklink cmd on the crontan file in win7, it could not working. Is this function possible, because I want to put the crontab file on the network drive.
Thanks,
Tim
Hi,
the cron-tool was exactly I was looking for. But I can not get it to work. It runs and gives a ReturnCode of 1, but the called Batchfile is not executed.
I do that:
*/1 * * * * 9 “C:\Kopie1.bat” /c
The batch itself runs fine. Any idea whats is going wrong?
Ullrich
Hello Ullrich,
What does the logfile say? There is a log file in the same folder as the cron app.
Also, I want to let everyone know we are listening to your requests, and are building a feature list for Windows Cron 3.0…so please be paitent…and post any requests you have to this page.
Thanks,
Steve
Hi Steve,
I only see lines like this:
[2012/09/14 – 16:39:00] Executed [C:\WINDOWS\System32\cmd.exe] with arguments [/c “”C:\Kopie1.bat” /c”] Session ID: 0 Return Code: 1
Cheers
Ullrich
Hi Ullrich,
It looks like it is executing. Open the cron settings, and set that file to run in the current console session, and put a pause at the end of your bat file…see if there are any errors.
Thanks,
Steve
Hi Steve,
ah, it says “can not find the path.”
Could that come from that the source-path is a mapped network-drive?
Kind regards
Ullrich
Yes. That would be the problem. What about using a UNC path instead? Or mapping the drive in the script.
Make sure you do not use the system account since it is restricted from using network resources
Hi Steve,
I just tried to use UNC-path. Now it says Access denied. But Cron is running as local Admin. Calling the bat works fine for both, UNC and mapped drive
So how is the cron util calling the bat-file? What can I do else?
Cheers
Ullrich
Hi Ullrich,
It may not work in its current form. I think one way around it is to have it run as local admin, but in the console session, and hidden. One of the things MS has been doing is locking down the CreateProcess API. In some of the latest patches network sharing has not been working unless you are executing from the current console session.
One way around this is for us to allow you to provide credentials to the cron app…that would solve the issue 100%. We are working on that right now…but it will be a while before the next release.
Steve
Hi Steve,
thanks for your reply. Unfortunately this doesn’t work either. What do you think, when the next release will be available?
Kind regards
Ullrich
Hello again Steve!
I’m using cron service to run a php script every one hour. It works like a charm if I am logged in the server that cron is running (I access it remotely) but if I logout, the php script doesn’t run.
When I am logged in it works and this two lines are generated in the status log file:
[2012/10/06 – 21:00:00] Executed [C:\PHP\php.exe] with arguments [-q -f “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/deccareims/scripts/EnvioNewsletter.php”] Session ID: 0 Return Code: 1
[2012/10/06 – 21:00:00] Executed [C:\PHP\php.exe] with arguments [-q -f “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/deccareims/scripts/EnvioNewsletter.php”] Session ID: 3 Return Code: 0
but when I am logged off it doesn’t run, and generates just this line:
[2012/10/06 – 22:00:00] Executed [C:\PHP\php.exe] with arguments [-q -f “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/deccareims/scripts/EnvioNewsletter.php”] Session ID: 3 Return Code: 0
Is this an issue of cron service or am I doing something wrong?
Crontab is running as local administrator, and has the options “Execute in the console session” and “Execute in any active RDP session” checked. The server operating system is Windows XP. Any help is welcome! 🙂
Thanks in advance, and congratulations for your great work!!!