how to run anothor file in a function of current file using cron concept?

19 views
Skip to first unread message

Avnesh Shakya

unread,
May 18, 2013, 12:45:39 AM5/18/13
to apsch...@googlegroups.com
hi,
   I want to run a another file inside a ached.add_cron_job(..). how is it possible, please help me
example --

import otherFile
from apscheduler.scheduler import Scheduler
sched = Scheduler()
sched.start()

def job_function():
    # Can I here add that file for execution, Or can i add that file directly inside cron?
   
sched.add_cron_job(job_function, month='1-12', day='1-31', hour='0-23',minute='44-49')

Alex Grönholm

unread,
May 18, 2013, 3:08:46 PM5/18/13
to apsch...@googlegroups.com
18.05.2013 07:45, Avnesh Shakya kirjoitti:
> hi,
> I want to run a another file inside a ached.add_cron_job(..). how
> is it possible, please help me
> example --
http://docs.python.org/3/library/subprocess.html#module-subprocess
>
> import otherFile
> from apscheduler.scheduler import Scheduler
> sched = Scheduler()
> sched.start()
>
> def job_function():
> # Can I here add that file for execution, Or can i add that file
> directly inside cron?
>
> sched.add_cron_job(job_function, month='1-12', day='1-31',
> hour='0-23',minute='44-49')
> --
> You received this message because you are subscribed to the Google
> Groups "APScheduler" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to apscheduler...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
0 new messages