Skip to content

Instantly share code, notes, and snippets.

@msfidelis
Created January 31, 2016 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msfidelis/5c150dac3014d6dd27ca to your computer and use it in GitHub Desktop.
Save msfidelis/5c150dac3014d6dd27ca to your computer and use it in GitHub Desktop.
#CONSTROI O ARQUIVO E PATH DE BACKUP E RETORNA
def gerabackup():
date = (time.strftime("%Y-%m-%d"))
backupfile = '%s-backup-full.tar.gz' % date # Cria o nome do arquivo de Backup
pathdestino = '/mnt/hdbackup/%s' % backupfile # Destino onde será gravado o Backup
pathorigem = '/mnt/storage/' # pasta que será 'backupeada'
backup = 'tar cvf %s %s' % (pathdestino, pathorigem) # Comando de execução
return backup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment