-
-
Save msfidelis/ccad69e8fceea4ec1592 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CONSTROI O ARQUIVO E PATH DE BACKUP E RETORNA | |
def gerabackup(): | |
date = (time.strftime("%Y-%m-%d")) | |
opts = 'Cravzp' | |
#opts = 'rvtl' # Opções que serão passadas com Rsync. Comentários no inicio do Script :) | |
exclude = '*.log, *.tmp, .recycle' # Define os diretórios e tipos de arquivos que não vão ter backup | |
pathdestino = '/mnt/backupclone/' # Destino onde será gravado espelhado o backup | |
pathorigem = '/mnt/storage/' # pasta que será 'backupeada' | |
backup = 'rsync -%s --exclude={%s} %s %s' % (opts, exclude, pathorigem, pathdestino) # Comando de execução | |
#print backup | |
#sys.exit() | |
return backup | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment