Add delete_cronjobs command to run.py

This commit is contained in:
Brandon Cornejo 2014-10-04 20:21:00 -05:00
parent 6e09c8d119
commit 7c3eade8dc
2 changed files with 9 additions and 6 deletions

View File

@ -80,11 +80,6 @@ def teamspeak():
def friends():
return render_template('friends.html')
# Stream pages
@app.route('/shaneomad')
def twitch_shaneomad():
return render_template('potatr.html', twitch_id=app.config.TWITCH_CLIENT_ID)
# User profile page
@app.route('/user/<int:userid>')
def user_profile(userid):

10
run.py
View File

@ -57,7 +57,15 @@ def install_cronjobs():
print "Problem installing cronjobs: {}".format(e)
else:
cron.write()
print "Cron jobs written succesfully"
print "Cron jobs written successfully"
@manager.command
def delete_cronjobs():
from os import path
from crontab import CronTab
cron = CronTab(user=True)
cron.remove_all(comment='DOOBSAUTO')
print "Existing cronjobs deleted successfully"
@manager.command
def admin(name):