lib/gettor/utils.py
def installCron():
    """Install all needed cronjobs for GetTor
    """
    logging.debug("Installing cronjob..")
    # XXX: Check if cron is installed and understands our syntax?
    currentCronTab = getCurrentCrontab()
    path = os.getcwd() + "/" + os.path.basename(sys.argv[0])
    args = " --clear-blacklist=7 --fetch-packages --prep-packages"
    newCronTab = currentCronTab + '\n' + '3 2 * * * ' + path + args
    echoCmd = ['echo', newCronTab ]
    cronCmd = ['crontab', '-']
    echoProc = subprocess.Popen(echoCmd, stdout=subprocess.PIPE)
    cronProc = subprocess.Popen(cronCmd, stdin=echoProc.stdout)
    cronProc.communicate()[0]
    return cronProc.returncode
Install all needed cronjobs for GetTor
    
Install all needed cronjobs for GetTor
Install all needed cronjobs for GetTor
def installCron():
    logging.debug("Installing cronjob..")
    currentCronTab = getCurrentCrontab()
    path = os.getcwd() + "/" + os.path.basename(sys.argv[0])
    args = " --clear-blacklist=7 --fetch-packages --prep-packages"
    newCronTab = currentCronTab + '\n' + '3 2 * * * ' + path + args
    echoCmd = ['echo', newCronTab ]
    cronCmd = ['crontab', '-']
    echoProc = subprocess.Popen(echoCmd, stdout=subprocess.PIPE)
    cronProc = subprocess.Popen(cronCmd, stdin=echoProc.stdout)
    cronProc.communicate()[0]
    return cronProc.returncode
def installCron ( ) : logging . debug ( "Installing cronjob.." ) currentCronTab = getCurrentCrontab ( ) path = os . getcwd ( ) + "/" + os . path . basename ( sys . argv [ 0 ] ) args = " --clear-blacklist=7 --fetch-packages --prep-packages" newCronTab = currentCronTab + '\n' + '3 2 * * * ' + path + args echoCmd = [ 'echo' , newCronTab ] cronCmd = [ 'crontab' , '-' ] echoProc = subprocess . Popen ( echoCmd , stdout = subprocess . PIPE ) cronProc = subprocess . Popen ( cronCmd , stdin = echoProc . stdout ) cronProc . communicate ( ) [ 0 ] return cronProc . returncode
Install all needed cronjobs for GetTor
Install all needed cronjobs for GetTor
"""Install all needed cronjobs for GetTor
    """ # XXX: Check if cron is installed and understands our syntax?