SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Files Backup
O Homem é a espécie mais insana.
Venera um Deus invisível e destrói a Natureza visível…
Sem se aperceber de que esta Natureza, que ele destrói,
é o Deus invisível que ele venera
Hubert Reeves
< Backup one Directory | Backup Several Directories | Backup MySQL >

Backup Several Directories

Call previous script:
Python Listing: ../../backup.uploads.py.
#!/usr/bin/python

import os
src_path="/usr/local"
systems=["SiPos","Sivent2","SiMon","Siolymp"]
sub_paths=["Uploads"]

hosts=["ole@ime","ole@sade",]


dayly_bin="/usr/local/sbin/dayly.tar.py"

for system in systems:
   rsystem=system.lower()
   for sub_path in sub_paths:
      path="/".join(   [src_path,rsystem,system,sub_path]   )

      print ("Running:\n\t"+" ".join([
         dayly_bin,
         path,
         ".".join(   [rsystem,sub_path]   )
      ]+hosts))
      os.system(" ".join([
         dayly_bin,
         path,
         ".".join(   [rsystem,sub_path]   )
      ]+hosts))
< Backup one Directory | Backup Several Directories | Backup MySQL >
Messages:
0 secs.