@task
def install_crontab():
 assert env.nodetype, 'no nodetype specified'
 assert env.host_string, 'no hosts specified'
 cron_file = ('~/viewfinder/scripts/crontab.%s' % env.nodetype.lower())
 with settings(warn_only=True):
  run(('if [ -e %s ]; then crontab %s; else crontab -r; fi' % (cron_file, cron_file)))

@ task def install_crontab ( ) : assert env . nodetype , 'no nodetype specified' assert env . host_string , 'no hosts specified' cron_file = ( '~/viewfinder/scripts/crontab.%s' % env . nodetype . lower ( ) ) with settings ( warn_only = True ) : run ( ( 'if [ -e %s ]; then crontab %s; else crontab -r; fi' % ( cron_file , cron_file ) ) )
install or remove crontab for given node type .