Donate

If you like one of these programs you can make a donation to support free software. Make payments with PayPal - it's fast, free and secure!

Thank you!

pycron

Instructions

A good introductory article about pycron can be found at http://www.bigbluehost.com/article4.html
"This article will discuss using a Cron type system, as used on Unix and Linux systems, to bring the flexibility, scalability and a need for more out of a task automation tool, to the Win32 environment."

pycron is a cron service written in Python converted to an executable with py2exe. It's a successor to cron with a couple of changes and extensions:

New in version 0.5:

  1. rotating log file (pycron.log pycron.log.1 pycron.log.2 - each max. 100k)
  2. output of process id in log file (except python scripts)
  3. support of environment variables in commands (e.g. %comspec%)
  4. weekdays and month can be specified as names
  5. config file pycron.cfg (crontab location, log file location and weekday format)
  6. changed day of Week back to unix format (can be changed to version 0.4 mode in crontab.cfg)

Download

Please follow the link to download the Setup program.

Version: Download link:
pycron Version 0.5.9 http://www.kalab.com/freeware/pycron/pycron-0.5.9.0.exe (3.08MB)
pycron Version 0.5.9 64-bit http://www.kalab.com/freeware/pycron/pycron-a64-0.5.9.1.exe (4.27MB)

Setup as a service

  1. copy the included file crontab.txt.sample to crontab.txt and change it to your needs
  2. go to the service manager and change the "Python Cron Service" options

The crontab.txt file

Each line of CRONTAB.TXT has the following structure:

<Minute> <Hour> <Day> <Month> <Day of Week> <Command line>

Position: Values:
Minute 0-59
Hour 0-23
Day 1-31
Month 1-12 or use names
Day of week 0-6 (0=Sunday, 1=Monday, ..., 6=Saturday) or use names

Instead of minute, hour, day, month or day of week it's also possible to specify a *. A * represents all possible values for that position (e.g. a * on 2nd position is the same as specifying all the possible values for hour)

Several values can be separated by commas: e.g. if a command is to be executed every 10th minute so you can specify 0,10,20,30,40,50 for minute. A range of values can be specified with a -: e.g. value 0-12 for hour -> every hour a.m.

A divider is specified by "/": */2 specified for minute means every second minute. 5-10/2 for hour matches every second hour from 5 to 10.

Line continuation character: " \". Please note: there has to be a space before "\". There's no character allowed after "\".

Comments

Every line starting with a "#" is treated as a comment.

character '?'

... means "time of pycron startup". Internally all the ? get replaced by the current time. So if you specify e.g.

? ? * * * command

The command gets executed on startup of the pycron service and then every day at the same time (if the computer is not turned off in between). If the cron service was started e.g. at 10:29 the command gets executed at 10:29 and at 10:29 the following days.

Examples

See the included file crontab.txt.sample for examples.

Crontab Editor

screenshot

Included is an editor for crontab.txt files. Click on the screenshot to view a larger image.