Questions tagged [scheduled-tasks]

A scheduled task is a computer task that is scheduled to happen at a certain time and may repeat.

Scheduled tasks are used for automation so that human presence in not required in order to execute the required task at the required time. Tasks may be scheduled to run once, or repeatedly at a specific time of a specific date.

Tasks may also be scheduled to run when specific preconditions are met. This is usually achieved by running a second scheduled task that runs sufficiently frequently, checking for preconditions, executing the desired program when these preconditions are met.

Tasks may be scheduled:

  • On *NIX: using cron. See
  • On Windows: using Windows Scheduled tasks

Lots of task automation software exists, including

7207 questions
155
votes
10 answers

How to schedule a function to run every hour on Flask?

I have a Flask web hosting with no access to cron command. How can I execute some Python function every hour?
RomaValcer
  • 2,786
  • 4
  • 19
  • 29
151
votes
8 answers

scheduleAtFixedRate vs scheduleWithFixedDelay

What's the main difference between scheduleAtFixedRate and scheduleWithFixedDelay methods of ScheduledExecutorService? scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { …
Sawyer
  • 15,581
  • 27
  • 88
  • 124
141
votes
6 answers

I need a Nodejs scheduler that allows for tasks at different intervals

I am looking for a node job schedule that will allow me to schedule a number of tasks at different intervals. For instance, call function A every 30 seconds call function B every 60 seconds call function C every 7 days I also want to be able to…
user379468
  • 3,989
  • 10
  • 50
  • 68
136
votes
10 answers

How do I capture the output of a script if it is being ran by the task scheduler?

Using Windows Server 2008, how do I go about capturing the output of a script that is being ran with the windows task scheduler? I'm testing a rather long custom printing batch-script, and for debugging purposes, I would like to see all of the…
Anthony Miller
  • 15,101
  • 28
  • 69
  • 98
128
votes
5 answers

Scheduling recurring task in Android

I'm designing an app that has a recurring task of sending presence to a dedicated server as long as the app is in foreground. In my searches across the web I saw a few different approaches and wanted to know what is the best way of doing this. What…
thepoosh
  • 12,497
  • 15
  • 73
  • 132
126
votes
2 answers

Pros and cons to use Celery vs. RQ

Currently I'm working on python project that requires implement some background jobs (mostly for email sending and heavily database updates). I use Redis for task broker. So in this point I have two candidates: Celery and RQ. I had some experience…
Max Kamenkov
  • 2,478
  • 3
  • 22
  • 19
125
votes
11 answers

windows service vs scheduled task

What are the cons and pros of windows services vs scheduled tasks for running a program repeatedly (e.g. every two minutes)?
Manu
  • 28,753
  • 28
  • 75
  • 83
121
votes
7 answers

Setting up a cron job in Windows

I have to download a file from an SFTP server everyday. I have the program which retrieves the file from the server but I was thinking of setting up a cron job (or anything similar) to automate that. We are a Windows shop and need to set up the cron…
mona
  • 6,079
  • 12
  • 41
  • 46
116
votes
13 answers

How to convert Linux cron jobs to "the Amazon way"?

For better or worse, we have migrated our whole LAMP web application from dedicated machines to the cloud (Amazon EC2 machines). It's going great so far but the way we do crons is sub-optimal. I have a Amazon-specific question about how to best…
Tom
  • 14,041
  • 16
  • 64
  • 80
115
votes
7 answers

How do I set a task to run every so often?

How do I have a script run every, say 30 minutes? I assume there are different ways for different OSs. I'm using OS X.
stalepretzel
  • 15,543
  • 22
  • 76
  • 91
114
votes
14 answers

How to check if a service is running via batch file and start it, if it is not running?

I want to write a batch file that performs the following operations: Check if a service is running If is it running, quit the batch If it is not running, start the service The code samples I googled so far turned out not to be working,…
citronas
  • 19,035
  • 27
  • 96
  • 164
113
votes
11 answers

How to conditionally enable or disable scheduled jobs in Spring?

I am defining scheduled jobs with cron style patterns in Spring, using the @Scheduled annotation. The cron pattern is stored in a config properties file. Actually there are two properties files: one default config, and one profile config that is…
Pierre Henry
  • 16,658
  • 22
  • 85
  • 105
106
votes
10 answers

Does spring @Scheduled annotated methods runs on different threads?

I have several methods annotated with @Scheduled(fixedDelay=10000). In the application context, I have this annotation-driven setup: The problem is, sometimes some of the method executions get delayed by seconds and even…
froi
  • 7,268
  • 5
  • 40
  • 78
103
votes
14 answers

Scheduling Python Script to run every hour accurately

Before I ask, Cron Jobs and Task Scheduler will be my last options, this script will be used across Windows and Linux and I'd prefer to have a coded out method of doing this than leaving this to the end user to complete. Is there a library for…
sunshinekitty
  • 2,307
  • 6
  • 19
  • 31
101
votes
8 answers

Scheduling a job with Spring programmatically (with fixedRate set dynamically)

Currently I have this : @Scheduled(fixedRate=5000) public void getSchedule(){ System.out.println("in scheduled job"); } I could change this to use a reference to a property @Scheduled(fixedRateString="${myRate}") public void getSchedule(){ …
NimChimpsky
  • 46,453
  • 60
  • 198
  • 311