-2

I have to download some files from source at 10AM,1PM and 12AM in a day and after downloading is done,I need to send them to my database. I want to do this daily. What should i write in the space for "code for periodic tasks". Also please tell me if there are any other mistakes? Thanks in advance.

@app.task 
def download(args):
    //code for downloading 
    upload_to_db.delay(args)

@app.task
def upload_to_db(args):
    //code for saving to database

//code for periodic tasks
download.delay(args)     
  • StackOverflow is not an oursourcing community. Please make a serious attempt at solving the problem yourself first and then describe where you got stuck and why. StackOverflow folks will gladly and quickly help you then. They will not like your question as it is now. – Lutz Prechelt Mar 04 '15 at 18:11
  • @LutzPrechelt I tried many approaches given in the cron-tab schedules, but none of them satisfied my requirement. Everywhere it is given how to do the tasks at a particular time daily but not as per my requirement. That is why I posted this question. I am not asking without even giving a try. – user4327436 Mar 04 '15 at 19:15

1 Answers1

0

You can use celery beat for cron-style scheduling: http://celery.readthedocs.org/en/latest/userguide/periodic-tasks.html#crontab-schedules

nthall
  • 2,847
  • 1
  • 28
  • 36
  • 1
    Thanks for the link. I already went through that. That is about doing tasks at a particular time daily not at regular intervals daily. – user4327436 Mar 04 '15 at 19:17
  • both options are in there, just take another look. if you're 100% certain that cron-style scheduling won't solve your needs in this case, i'd appreciate some clarification of the requirements, because right now i don't see anything in your question that cron isn't the answer for – nthall Mar 04 '15 at 20:19