示例#1
0
    def get_pids(self,target):
        d=Remote.gen_login(target)
        # print d
        remote=Remote(d)

        lines=remote.execute("ps aux | grep python | grep -v grep",d['base_dir'])
        lines=lines.splitlines()
        d={}
        # print res

        for l in lines:
            sl=re.split(r' *', l)
            if len(sl) > 5:
                k=sl[-1]
                v=sl[1]

                d[k]=v

        return d
示例#2
0
def archive_files():
    ""
    def get_fidx():
        ""

    def get_idx_mock():
        ""
        p=os.curdir()
        return list_files_ext(p,'png')


    # fidx=get_fidx_mock()
    fidx=[]


    # curr_dt=get_timestamp()
    # for f in fidx:
    #     sl.move(f,curr_dt)

    tm=get_current_time()
    remote=Remote(Remote.gen_login('dataserver'))
    remote.execute('mkdir %s'%tm)
示例#3
0
 def __init__(self):
     # self.remote=Remote(Remote.gen_login(target))
     self.cfg=Env().getConfig()
     self.pids=self.get_all_pids()
     self.source=Remote.gen_login('smapsource')
     self.server=Remote.gen_login('smapserver')