Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1.  def install_poly_startup_task(self):
  2.         from crontab import CronTab
  3.         cron = CronTab(user='root')
  4.         if not cron.find_comment('poly_start'):
  5.             print "Installing poly_start crontab..."
  6.             job = cron.new(command='rtrdb -r data_service=8001 db &', comment='poly_start')
  7.             job.every_reboot()
  8.             if job.is_valid():
  9.                 print "poly_start crontab successfully installed."
  10.             else:
  11.                 print "poly_start crontab failed to install"
  12.         else:
  13.             print "poly_start crontab already installed"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement