Issue in jobs.hours.every

Bug #1479327 reported by chintan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-crontab
Invalid
Undecided
Unassigned

Bug Description

jobs.hours.every()
jobs.daily.every()

Showing output like below

* * * * * /var/www/witty1app/frontend/www/console.php command UpdateWorklog d 1

Please resolve this issue.
Thank you!

Revision history for this message
Martin Owens (doctormo) wrote :

Thank you for the bug report. I have just investigated the issue:

When I run the code above I get this error instead:

TypeError: every() takes at least 2 arguments (1 given)

What version of python-crontab are you using import crontab; print crontab.__version__

And could you explain a bit more about how you are using the api and what you expect it to do in these cases?

Changed in python-crontab:
status: New → Incomplete
Revision history for this message
chintan (chintanthakar) wrote :

Thank you for your humble reply

I am using this like I am reading one text file and than parse the day,hr,min from that file and pass that value to jobs.hours.every() functions and there is nothing happens to them that means it doesn't entry in crontab file according to value I passed.

example :

value = 1 # should run every hr

jobs.hours.every(value)

output
* * * * * /var/www/witty1app/frontend/www/console.php command

expected output

@hourly /var/www/witty1app/frontend/www/console.php command UpdateWorklog

Thank you !

Revision history for this message
chintan (chintanthakar) wrote :

I am using the version python-crontab 1.9.3 with python3
Thanks

Revision history for this message
Martin Owens (doctormo) wrote :

Ah I see. The problem is your use of the API. there are two ways to set the hours:

job.every().hour() == '@hourly' == '0 * * * *'

job.hours.every(1) == '- * - - - -'

Th first sets all time slices while the second only sets hours. This is deliberate so you can set hourly slices separately if you want.

Changed in python-crontab:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.